<el-form-item label="省/市/区" prop="province">
<el-cascader
placeholder="请选择"
:options="options"
v-model="location"
:props="{label: 'name', value: 'name'}"
@change="handleAddressChange"
></el-cascader>
</el-form-item>
回调处理
import options from './address.json'
data() {
return: {
// 省市区选择
options: options,
location: [],
}
},
methods: {
/** 选择省市区 */
handleAddressChange(e) {
this.form.province = e[0];
this.form.city = e[1];
this.form.district = e[2];
},
}
address.json 文件下载
链接:https://pan.baidu.com/s/1FTfpbGnFjATUcPbV79IITw
提取码:gdr9