zheling
zheling
> ES6中有 Object.assign() 方法,应该也可以解决你对于深克隆的需求吧? assign不是深克隆
```js let times = 0; var a = { [Symbol.toPrimitive]: function () { return ++times; } }; if (a == 1 && a == 2 && a == 3) {...
```js let list = [ { id: 1, name: '部门A', parentId: 0 }, { id: 2, name: '部门B', parentId: 0 }, { id: 3, name: '部门C', parentId: 1 }, {...
`EventBus`使用的是观察者模式, 观察者和被观察者都是用一个对象, `EventBus.addSubscribe(type,callback) / EventBus.emit(type)`; `Vue`双向数据绑定使用的是订阅-发布模式, `getter`添加依赖到`Dep`, `setter`通过`Dep.notify()`通知对应的`watcher`调用更新的回调函数.
用 `reduce` 搞定 ```js function normalize(input) { const arr = input.replace(/\[|\]/g, ',').split(',').filter(itm => itm); let result = {}; arr.reduce((obj, cur, idx) => { const temp = {}; temp.value = cur;...
```js add(1); // 1 add(1)(2); // 3 add(1)(2)(3); // 6 add(1)(2, 3); // 6 add(1, 2)(3); // 6 add(1, 2, 3); // 6 function add(...args) { let final = [...args];...
根据 `x.y.z` 来迭代 ```js var entry = { 'a.b.c.dd': 'abcdd', 'a.d.xx': 'adxx', 'a.e': 'ae' } function transformReverse(entry) { const output = {}; Reflect.ownKeys(entry).forEach(key => { const val = entry[key]; const...
```js function transform(arr) { const set = new Set(arr.map(itm => itm !== void 0 ? JSON.stringify(itm) : void 0)); return Array.from(set).map(itm => { if (itm === void 0) return void...
I met this problem . I think the reason why you get a 403 Forbidden is that cache file used by serviceWorker does not update in time.
package version: `"vue": "^3.4.21", "vuedraggable": "^4.0.1"` code: ``` {{ element.name }} ``` 换 `"vuedraggable": "^4.0.1"` 这个版本后我这边正常, 没有出现这个错误了