摘要: ```javascript class Element{ constructor(type, props, children) { this.type = type this.props = props this.children = children } } function createElement (type, props, children) { return new Element(t 阅读全文
posted @ 2020-05-21 21:50 一只小鲸鱼 阅读(308) 评论(0) 推荐(0)
摘要: ```javascriptfunction Mvvm(options = {}) { this.$options = options let data = this._data = this.$options.data //数据劫持 observe(data) //数据代理 //为了不用写如mvvm._data.a.b这种 //可以直接写mvvm.a.b ... 阅读全文
posted @ 2020-05-21 21:48 一只小鲸鱼 阅读(183) 评论(0) 推荐(0)
摘要: 网站的页面和服务器API以及写好,并且在本地环境中调试成功。所有的功能都没有异常,当我将其部署到阿里云轻量级服务器上的时候,问题出现了。 Provisional headers are shown 报错 这个报错的翻译是临时请求报文头,简单来说就是 请求没有发出去 为什么回报这个错误? 通过研究控制 阅读全文
posted @ 2020-05-16 01:29 一只小鲸鱼 阅读(242) 评论(0) 推荐(0)
摘要: 恢复内容开始 这是因为此时的this是:undefined!在result.then这个方法改变了this的指向 解决方案: 使用箭头函数, 恢复内容结束 阅读全文
posted @ 2020-05-12 00:47 一只小鲸鱼 阅读(13503) 评论(0) 推荐(0)
摘要: JavaScript this 关键词指的是它所属的对象。 它拥有不同的值,具体取决于它的使用位置: 在方法中,this 指的是所有者对象。 单独的情况下,this 指的是全局对象。 在函数中,this 指的是全局对象。 在函数中,严格模式下,this 是 undefined。 在事件中,this 阅读全文
posted @ 2019-09-11 00:03 一只小鲸鱼 阅读(181) 评论(0) 推荐(0)