sponge

Results 7 comments of sponge

> 参考vue源码对v-model的实现中,对输入中文的处理 > > ``` > > ``` > > ```js > function jeiliu(timeout){ > var timer; > function input(e){ > if(e.target.composing){ > return ; > } > if(timer){ >...

箭头函数的this是上下文的this,它会从自己作用域的上一层继承this 箭头函数自身没有arguments(但是可以向作用域链中查找arguments), 不能使用yield命令,不能做generator函数 箭头函数不可以使用new,因为箭头函数没有prototype(使用new需要把函数的prototype赋值给新对象的__proto__),没有自己的this,不能调用call和apply

```js let list = [ { id: 1, name: '部门A', parentId: 0 }, { id: 2, name: '部门B', parentId: 0 }, { id: 3, name: '部门C', parentId: 1 }, {...

```js const a = 'AaAaAaAa123456' const func = str => str.replace(/[a-zA-Z]/g, v => /[a-z]/.test(v) ? v.toUpperCase() : v.toLowerCase()) console.log(a); // 'AaAaAaAa123456' console.log(func(a)); // 'aAaAaAaA123456' ```

```javascript const a = [1, 2, 2, 3] const b = [2, 2, 3, 4, 5] const c = [2, 2, 3, 6, 7, 2] const intersect = (...args) =>...

看你们随随便便就写出来了,我光是理解就要好久。。。

没看过这方面的源码,但是据说computed的依赖变化的时候如果没对computed里面的值进行使用,好像是不会触发computed的。