2.4.9
macOS Mojave v10.14 (18A391) / Chrome v69.0.3497.100
2.5.17
https://jsfiddle.net/undefined
hope the function checkSelectable only execute once per every row
the render function checkSelectable may have an infinite update loop
I‘am so sorry for can't apply the valid demo because the network of our company do not have access to https://jsfiddle.net/,but I will use the screenshot to elaborate the situation:



你这种写法,如果有10调数据,会循环100次
直接 return !row.registered就可以了吧,为啥要用个this,这里这个this是整个控件了,你所有的row的checkable都绑定到同一个bool对象上当然就来回循环了
你这种写法,如果有10调数据,会循环100次
直接 return !row.registered就可以了吧,为啥要用个this,这里这个this是整个控件了,你所有的row的checkable都绑定到同一个bool对象上当然就来回循环了
@Eflet 说的对。这种函数应该纯一点,不要有副作用。就像使用 React 时,在 render 函数里修改了 state,当然会造成死循环。
多谢楼上两位的回答,帮我找到问题所在~
Most helpful comment
你这种写法,如果有10调数据,会循环100次
直接 return !row.registered就可以了吧,为啥要用个this,这里这个this是整个控件了,你所有的row的checkable都绑定到同一个bool对象上当然就来回循环了