setup(props, { emit }) {
const treeRef: Ref = ref(null);
const state = reactive({
selectCandidates: false,
dept: '',
users: '',
initiator: '',
nameList: [],
attribute:'',
excelTitle:'',
nameListStorage: [],
receiveName: [],
defaultProps: {
children: 'childList',
label: 'excelTitle',
id: 'excelTemplateId',
disabled: disabledFn, //这里设置禁用函数
},
});
//设置禁用
function disabledFn(data:any){
// console.log(data)
if(data.childList.length>0){ //可以根据数据来做判断禁止功能
return true
}
}
elementPlus中tree中禁止功能使用
最新推荐文章于 2024-03-15 08:30:00 发布