standbill's recent timeline updates
standbill

standbill

V2EX member #229613, joined on 2017-05-08 09:05:32 +08:00
standbill's recent replies
是啊。
vue 的 vetur 出问题了。
主要原因是 vscode 更新太快,但是周边的插件更新不频繁。
有些是周边插件更新太快,vscode 本身还没反应过来。
需要做递归组件。最内层的 选框有初始值 v。
大概就是这样。
checked:{

get(){
if(this.children&&this.children.length>0){
return this.children.filter(v=v.checked).length === this.children.length
} else {
return this.v
}
// 或者 every 也行。
}
set(value){
//
if(this.children&&this.children.length>0) {
this.children.forEach(v=>{
v.checked = value
})
} else {
// 最内层了
this.v = value
}
}


}

其他方法也有。
手动写递归赋值什么的,不依靠依赖收集。
还可以用 store 的 getters 返回函数,进行计算属性的依赖收集。
@yantianqi 很久以前做的。回去了找下发给你。😁
Sep 25, 2017
Replied to a topic by plainnany 求职 前端新人求工作,跪求各位大佬指点
@zaxlct shabileable
Sep 6, 2017
Replied to a topic by Vkin JavaScript 如何用 js 模拟网页的滑动验证码?
手机端滑动,有 touch 事件。电脑端有 mousedown mouseup。
getconputedStyle,可以获得计算属性。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3049 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 14:09 · PVG 22:09 · LAX 07:09 · JFK 10:09
♥ Do have faith in what you're doing.