Binteng
Binteng
```JS const data = [ { id: '1', name: '父节点1', children: [ { id: '1-1', name: '子节点1-1', children: [ { id: '1-1-1', name: '子节点1-1-1' }, { id: '1-1-2', name: '子节点1-1-2'...
```JS Function.prototype.myCall = function (context, ...args) { context = context || window args = args || [] const key = new Symbol() context[key] = this const res = context[key](...args) delete...
```html import { nextTick, reactive, ref } from 'vue' const activeName = ref('') let tabs = [ { title: 'tab1' }, { title: 'tab2' }, { title: 'tab3' } ]...
> 这样是可以的,但在实际业务中tabs是远程获取的,所以要对响应式对象重新赋值 @liaoruikang 其实可以改变key来保证视图更新 ```html prop slot {{item.title}} import { nextTick, reactive, ref } from 'vue' const activeName = ref('') let tabs = [ { title: 'tab1' }, { title:...
我的荣幸😁 @liaoruikang
  [[Ant Design](https://ant.design/)](https://ant.design/components/date-picker) 参考ant design 的 week,我觉得自动判定为下一年的第一周即可,加参数我感觉不太合适
> >   [[Ant Design](https://ant.design/)](https://ant.design/components/date-picker) 参考ant design 的 week,我觉得自动判定为下一年的第一周即可,加参数我感觉不太合适 > > `按照ISO 8601标准,每年的1月1日不是周一的话,算作上一年的第53周,每年第一周是从1月1日开始的第一个周一算起的。` 这是目前在知乎和GPT中得的回答 sorry, 我刚看到,那我这个pr错了
```js console.log([] instanceof Array); function myInstanceof(left, right) { let protoLeft = Object.getPrototypeOf(left) let protoRight = right.prototype while (true) { if (protoLeft === null) return false if (protoLeft === protoRight) return...
```js let obj = { a: 1, b: 2, c: { c: 1, d: 2 } } function deepClone(obj) { let clone = Array.isArray(obj) ? [] : {} for (let...
```js const arr = [1, [2, 3, [4, 5]], 1, 2, [6, 7]] Array.prototype.flat = function (deep = 1) { let result = [] for (let item of this) {...