2.3.0
https://jsfiddle.net/yyx990803/4dr2fLb7/?utm_source=website&utm_medium=embed&utm_campaign=4dr2fLb7
js代码的135行:
if (value) {
这里的value从文档上看应该是一个binding对象,如果这样判断,这个if的值永远为true,因此这个if毫无意义。
按照上下文逻辑,这里应该是if(value.value)才对或者直接是:
'todo-focus': function (el, binding) {
if (binding.value) {
el.focus()
}
}
如果我理解没错,希望作者改进一下,看到这里的时候很容易产生误导。
如果我理解错了,希望理解,才接触vue不久,谢谢!
if(Boolean)
if(Object)
🐮 👃
🐮 👃
Nice catch 🙂
I notified Evan since he's the one that can edit that fiddle. It should be fixed soon
@posva Thanks very much!
Fixed, thanks!
Most helpful comment
Nice catch 🙂
I notified Evan since he's the one that can edit that fiddle. It should be fixed soon