npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

moretv-province

v0.1.3

Published

moretv vue2 province city area select;vue2 最新省份城市地区级联选择

Downloads

4

Readme

功能介绍

  • 支持两种UI风格:普通原生下拉列表,element-ui下拉列表;
  • 支持仅读方式配置;
  • 支持配置显示级别:显示省份,显示省份+城市,显示省份+城市+区县;
  • 支持配置默认选中的省份、城市以及区县;

属性配置说明

| 属性名 | 默认值 | 取值说明 | | :------------: |:---------------:| :-----:| | readOnly | false | 仅读标识:boolean类型,true:仅读,false:可编辑 | | level | 3 | 显示级别:int类型,1:只显示省份,2:显示省份+城市,3:显示省份+城市+区县 | | useElementUI | false | 是否使用element-ui组件:boolean类型,true:使用element-ui下拉列表组件,false:使用原生select标签 | | province | 空 | 默认选中省份:string或int类型,string类型时为省份中文模糊查询,int类型时为省份code值,精确匹配 | | city | 空 | 默认选中城市:string或int类型,string类型时为城市中文模糊查询,int类型时为城市code值,精确匹配 | | area | 空 | 默认选中区县:string或int类型,string类型时为区县中文模糊查询,int类型时为区县code值,精确匹配 |

事件回调说明

| 事件 | 事件说明 | 参数说明 | | :------------: |:---------------:| :-----:| | provinceChange | 省份选择改变回调 | Object | | cityChange | 城市选择改变回调 | Object | | areaChange | 区县选择改变回调 | Object |

方法说明

| 方法 | 方法说明 | 参数说明 | | :------------: |:---------------:| :-----:| | getData | 获取当前选择的省份、城市、区县数据 | Object |

安装

npm install moretv-province --save

引用

import MtvProvince from 'moretv-province'
components:{MtvProvince},
<mtv-province useElementUI ref="mtvProvince" :province="'江西'" :city="360100" :area="360104" @provinceChange="provinceChange" @cityChange="cityChange" @areaChange="areaChange"></mtv-province>

获取组件数据

this.$refs.mtvProvince.getData()

组件返回的数据格式

{
    area:{required: true, code: 360104, name: "青云谱区"},
    city:{required: true, code: 360100, name: "南昌市"},
    province:{required: true, code: 360000, name: "江西省"}
}

required:表示该字段是否需要选择,主要针对直辖市没有区县以及台湾、香港、澳门没有城市及区县,即可不选择; true:代表有值,应该选择,false代表没有值,不选

备注

数据来源:2018年7月中华人民共和国县以上行政区划代码