bm-address-form
v1.0.4
Published
> This is a plugin for address form
Downloads
2
Readme
bm-address-form
用于本末项目内表单的地址选择器, 依赖element-ui select组件, 地址信息在chinaAddress.json中配置
安装
npm install bm-address-form -s
import Vue from 'vue'
import bmAddressForm from 'bm-address-form'
Vue.use(bmAddressForm)
<template>
<div>
<address-form v-model="address"
:disabled="disabled"
:showAddress="showAddress"></address-form>
</div>
</template>
<script>
export default {
data () {
return {
disabled: false,
address: {
province: {
// 省
name: '',
value: '3400001'
},
city: {
// 市
name: '',
value: '3400001'
},
area: {
// 区
name: '',
value: '3400001'
},
detail: 'XXXX街道XXXXX号' // 详细地址
},
showAddress: false
}
}
}
</script>
参数注解
address: 地址对象, 使用双向绑定, 从接口返回的数据如果与上面示例的数据格式不一样,必须改成示例格式,否则会报错
showAddress: 是否展示详细地址这一行
disabled: 是否禁用