上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页
摘要: ####格式化 HTML:即 vue(template):vetur插件 https://blog.csdn.net/xiaomajia029/article/details/88222602 vscode中使用beautify插件格式化vue文件(自定义快捷键) :https://blog.csd 阅读全文
posted @ 2020-11-19 19:34 17135131xjt 阅读(1224) 评论(0) 推荐(0) 编辑
摘要: <script> function x() { } //为函数x的prototype原型对象添加add方法 x.prototype.add = function (a) { return a } var xxx = new x() console.log(xxx.add);//函数add conso 阅读全文
posted @ 2020-11-18 20:20 17135131xjt 阅读(128) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2020.cnblogs.com/blog/1968139/202011/1968139-20201118180508411-11950698.png) 阅读全文
posted @ 2020-11-18 18:06 17135131xjt 阅读(122) 评论(0) 推荐(0) 编辑
摘要: ###总结:then中的代码是同步执行的即使是链式调用也是如此。但then中的回调函数一定要等待前面返回promise结果才能执行。 const a = new Promise((resolve, reject) => { console.log(2); }).then(function x() { 阅读全文
posted @ 2020-11-17 20:52 17135131xjt 阅读(66) 评论(0) 推荐(0) 编辑
摘要: <script> var x = 0 Object.defineProperty(this, 'a', { get() { x++ console.log('get'); return x } }) console.log(a 1 && a 2 && a 3); var obj = { } Obje 阅读全文
posted @ 2020-11-17 10:30 17135131xjt 阅读(59) 评论(0) 推荐(0) 编辑
摘要: <script> try { throw new Error() } catch (err) { var test = "Hello" const test2 = "Hi" console.log(err); //Error } console.log(test); //Hello console. 阅读全文
posted @ 2020-11-16 21:51 17135131xjt 阅读(474) 评论(0) 推荐(0) 编辑
摘要: <script> //const、let定义在最上端的代码全局都可以访问,所以是全局作用域还是块级作用域? const a = 1 let b = 2 console.log(window.a); //undefined console.log(window.b); //undefined //显然 阅读全文
posted @ 2020-11-16 21:31 17135131xjt 阅读(773) 评论(0) 推荐(1) 编辑
摘要: ###测试1.未在data内注册的变量没有响应式,不具备响应式的变量值变化不会触发页面重新渲染 ###视图始终是 count:0,a:1; <template> <div id="welcome"> <!-- data内注册的变量才会具有响应式 --> <div>count:{{count}}</d 阅读全文
posted @ 2020-11-16 16:18 17135131xjt 阅读(257) 评论(0) 推荐(0) 编辑
摘要: ###一般的计算结果都用计算属性(如果是异步操作可以使用watch) ###测试代码 ###测试结果 <template> <div id="welcome"> <!-- 测试方法和computed --> <span>测试</span> <input type="text" v-model="x" 阅读全文
posted @ 2020-11-16 14:39 17135131xjt 阅读(83) 评论(0) 推荐(0) 编辑
摘要: //对象与Object的关系,以及Object与null的关系? //所有的对象都是Object的实例, //null是原型链的顶层 var obj = {} console.log(obj instanceof Object);//true //所有的对象都是Object的实例,(除了Object 阅读全文
posted @ 2020-11-15 21:51 17135131xjt 阅读(54) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 21 下一页