console
var Main = {
data() {
const val1 = []
const treeList = []
const treeConfig = {
trigger: 'node',
radioConfig: {
checkMode: 'last'
}
}
return {
val1,
treeList,
treeConfig
}
},
created() {
this.loadList()
},
methods: {
loadList() {
fetch('https://vxeui.com/resource/json/provinces_list.json')
.then((res) => res.json())
.then((data) => {
this.treeList = XEUtils.toArrayTree(data, { key: 'id', parentKey: 'parentId' })
})
}
}
};
var app = new Vue(Main).$mount('#app')
<script src="https://unpkg.com/vue@2.6.14">
</script>
<script src="https://unpkg.com/xe-utils">
</script>
<script src="https://unpkg.com/vxe-pc-ui@3.16.25">
</script>
<script src="https://unpkg.com/vxe-table@3.22.9">
</script>
<div id="app">
<template>
<div>
<vxe-tree-select multiple show-checkbox filterable clearable show-checked-button show-clear-button show-total-button show-close-button
show-expand-button show-full-label v-model="val1" :options="treeList" :treeConfig="treeConfig" :option-props="{ value: 'id', label: 'name' }"
style="width:300px"
/>
</div>
</template>
</div>
@import url("https://unpkg.com/vxe-pc-ui@3.16.24/lib/style.css");
@import url("https://unpkg.com/vxe-table@3.22.9/lib/style.css");