vue.js-地址选择插件
第一步自然是安装 npm install v-distpicker --savetest.vue import VDistpicker from 'v-distpicker'export default { components: { VDistpicker }} <v-distpicker></v-distpic
第一步自然是安装
npm install v-distpicker --save
test.vue
import VDistpicker from 'v-distpicker'
export default {
components: { VDistpicker }
}
<v-distpicker></v-distpicker>
写到这里效果就已经出来了,简单吧
接下来介绍一下常用配饰项
默认地址:
<v-distpicker province="广东省" city="广州市" area="海珠区"></v-distpicker>
手机样式
<v-distpicker type="mobile"></v-distpicker>
最重要的获取选中的值,这一步找了很久才找到,官网和github上都没找到介绍
<v-distpicker type="mobile" @selected="onSelected"></v-distpicker>
onSelected:function(data){
this.$store.state.citydata = data.province.value + data.city.value + data.area.value
console.log(this.$store.state.citydata)
}
更多推荐
所有评论(0)