1、安装vue-area-linkage插件:npm install --save vue-area-linkage --

2、main.js里面注入

import VueAreaLinkage from 'vue-area-linkage'
import 'vue-area-linkage/dist/index.css'
Vue. use( VueAreaLinkage)

3、组件里:

< area-select type= 'all' :placeholders=" placeholders" :level=' 2' v-model=" send_search_form. selected" :data=" pcaa" >
</ area-select >
// 三级联动
import { AreaSelect } from "vue-area-linkage";
import AreaData from "area-data";
import { pca, pcaa } from "area-data";
export default {
component: {
AreaSelect: AreaSelect
},
data() {
return {
pca: pca,
pcaa: pcaa,
placeholders: [ " ", " ", " "],
      send_search_form: {
orderCode: "",
itemName: "",
orderTime: [],
consigneeName: "",
state: "",
selected: []
},
},
}



Logo

前往低代码交流专区

更多推荐