Fork me on GitHub
摘要: vue是怎么重写数组方法的 const arrayProto = Array.prototype export const arrayMethods = Object.create(arrayProto) const methodsToPatch = [ 'push', 'pop', 'shift' 阅读全文
posted @ 2021-05-02 21:15 Kaicy 阅读(1520) 评论(0) 推荐(0)
摘要: 为什么会有CommonJs和Es Module呢 我们都知道在早期JavaScript模块这一概念,都是通过script标签引入js文件代码。当然这写基本简单需求没有什么问题,但当我们的项目越来越庞大时,我们引入的js文件就会越多,这时就会出现以下问题: js文件作用域都是顶层,这会造成变量污染 j 阅读全文
posted @ 2021-05-02 20:15 Kaicy 阅读(393) 评论(2) 推荐(1)