项目作者: catbea

项目描述 :
基于vue2.0的仿美团的城市选择组件
高级语言: JavaScript
项目地址: git://github.com/catbea/vue-city-select.git
创建时间: 2019-01-12T10:35:38Z
项目社区:https://github.com/catbea/vue-city-select

开源协议:

下载


效果图

Image text

vue-city-select

A Vue.js project

Build Setup

  1. # install dependencies
  2. npm install
  3. # serve with hot reload at localhost:8080
  4. npm run dev
  5. # build for production with minification
  6. npm run build

For detailed explanation on how things work, consult the docs for vue-loader.

插件使用方法

npm i vue-city-select -S

在main.js中引入注册

  1. import vueCity from 'vue-city-select'
  2. vue.use(vueCity);
  3. //然后就可以在项目中引用了,热门城市 hotCityList 参数可以根据自己的需求传或者不传
  4. <vue-city :hotCityList="hotCityList" @changeCity="changeCity"></vue-city>

注意这里的vue-city就是组件vueCity.vue中的name 的名称。否则会报错的。