摘要: CLI 使用vue-cli可以快速搭建Vue开发环境以及对应的webpack配置 cnpm install -g @vue/cli // 如果需要使用旧版本的vue init功能(脚手架2),你可以全局安装一个桥接工具: cnpm install @vue/cli-init -g vue cli2初 阅读全文
posted @ 2020-01-18 22:05 cl94 阅读(143) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript"> let v = new Vue({ el : ".ball", data : {t:1}, beforeCreate : function(){ console.log('组件刚刚被创建!') console.log(this) }, 阅读全文
posted @ 2020-01-18 20:42 cl94 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 案例: ①匿名封装 (function(window,document){ const HEAD = 1; let MSG = function(options){ this._init(options); } //原型 MSG.prototype._init = function({msg}){ 阅读全文
posted @ 2020-01-18 20:02 cl94 阅读(150) 评论(0) 推荐(0) 编辑
摘要: ES6: ①let 特点:1 只能作用域当前作用域中; 2 使用let或者const声明的变量,不能再被重新声明; 3 let不存在变量提升 比如: console.log(dad); var dad = 1; 不会报错,因为上面的代码会被变量提升为: var dad; console.log(da 阅读全文
posted @ 2020-01-18 20:01 cl94 阅读(139) 评论(0) 推荐(0) 编辑