Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

element el-tree 设置动态禁用 延迟生效问题

发现出现不能及时更新禁用状态 要点击才能更新 而且是更新单个是什么原因

<el-tree
 ref="menuTree"
 v-model="roleActionVo.menuIds"
 :data="menuTree"
 show-checkbox
 node-key="menuId"
 style="overflow:?hidden;"
 default-expand-all
 :check-strictly="true"
 :props="defaultProps"
 :default-checked-keys="checkedId"
 @check="handleChange"
 />

封装禁用函数

function G(i, bool)?{
 //?第一级
 if (i._disabled === undefined)?{
 i._disabled = i.disabled === undefined ? false : i.disabled
 }
 i.disabled = bool
 //?如果有子级
 if (i.resources && i.resources !== undefined)?{
 R(i.resources, bool)
 }
 return i
}
export function R(s, bool)?{
 return s.map(i => {
 return G(i, bool)
 })
}

// 调用 R(Data, true) / R(Data, false)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

请问这个问题得到处理了吗?我也同样遇到了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...