Element UI 树形结构节点点击禁用新增按钮
数据列表
新增
function handleClick(ev,node) {
console.log('ev', ev);
console.log('node', node.level);////是第几层,如果是1 就把新增按钮隐藏disabled
console.log('ev.categoryId 点击的这个类目id是----', ev.categoryId); loading.value = true; queryParams2.categoryId = ev.categoryId; getSpecsPage(queryParams2) .then((data: any) => { SpecsList.value = data.rows; total.value = data.total; //页 }) .finally(() => { loading.value = false; });
if (node.level === 1) { this.disabled = true; } else { this.disabled = false; } }
// 在 data 中添加 disabled 变量 data() { return { disabled: false, // 其他数据... } }
原文地址: https://www.cveoy.top/t/topic/qfWt 著作权归作者所有。请勿转载和采集!