赞
踩
1、页面
<el-tree-select
class="oragn"
v-model="state.regionCode"
:data="state.options"
default-expand-all
:check-strictly="true"
:props="state.defaultProps"
placeholder="请选择区域"
filterable
teleported
:filter-method="filterMethod"
/>
2、js页面
// 获取区域树状结构列表-所属区域服务
let getRegionTreeData = async () => {
let params = {}
let res = await http.addRegionTree(params)
if (res && res.success) {
state.options = res.data
}
}
//树型结构筛选
const filterMethod = (value) => {
state.options.id = [...state.options].filter((item) => item.name.includes(value))
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。