安装数据源
npm install element-china-area-data -S
引用
import {regionData} from 'element-china-area-data'
<template>
<div>
<el-cascader
:options="options"
@change="handleChange"
v-model="selectedOptions"
placeholder="请选择地址"
>
</el-cascader>
<el-input v-model="longitude" ></el-input>
</div>
</template>
<script>
import {regionData} from 'element-china-area-data'
export default {
name: 'App',
components: {},
data() {
return {
options: regionData,
selectedOptions:[],
}
},
created() {
},
mounted() {
console.log(regionData, "-------")
},
methods: {
handleChange(){}
}
}
</script>
效果图
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/d5e87bc3c04857500300519532d2a010.png#pic_center)