0.1.5 • Published 6 years ago

vue2-city-selector v0.1.5

Weekly downloads
52
License
MIT
Repository
github
Last release
6 years ago

city-selector

city-selector是一款基于vue2+的全国城市筛选器

截图

出发城市

请选择城市

安装

npm

$ npm install vue2-city-selector

使用

<city-selector field="city" placeholder="请选择城市" :city-list="cityListArr" v-model="cityId"></city-selector>
// 全局使用
import Vue from 'vue';
import citySelector from 'vue2-city-selector'
Vue.use(citySelector)

// 局部引用
import {citySelector} from "vue2-city-selector";
export default {
    components: {
        citySelector
    },
    data() {
        return {
            cityId: '',
            cityListArr: {
                'hot': [
                    {id: 410500, name: "安阳市"}
                ],
                A: [
                    {id: 152900, name: "阿拉善盟"},
                    {id: 210300, name: "鞍山市"},
                    {id: 340800, name: "安庆市"},
                    {id: 410500, name: "安阳市"},
                    {id: 513200, name: "阿坝藏族羌族自治州"},
                    {id: 520400, name: "安顺市"},
                    {id: 542500, name: "阿里地区"},
                    {id: 610900, name: "安康市"},
                    {id: 652900, name: "阿克苏地区"},
                    {id: 654300, name: "阿勒泰地区"}
                ]
            }
        }
    }
}

相关参数

名称类型默认说明
v-modelString""要双向绑定的城市Id
fieldString""会给input标签添加name及id属性
placeholderString""提示信息
no-hotBooleanfalse没有‘热门城市’
city-listObject[]可以自定义城市列表
0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago