摘要: .vue data(){ return{ url:process.env.VUE_APP_UR } } .env VUE_APP_URL=https://api.com/ .env.development VUE_APP_URL=https://dev.api.com/ .env.productio 阅读全文
posted @ 2019-04-03 12:28 雨雪粪痘凯文 阅读(2666) 评论(0) 推荐(0) 编辑
摘要: const goods = require('./data/goods.json'); const ratings = require('./data/ratings.json'); const seller = require('./data/seller.json'); module.expor 阅读全文
posted @ 2019-04-03 12:27 雨雪粪痘凯文 阅读(376) 评论(0) 推荐(0) 编辑
摘要: <script> let vm=new Vue({ el:"#app", data:{ name:"liuting", }, beforeCreate(){ console.log("创建前:"); console.log(this.$el); console.log(this.$data); }, 阅读全文
posted @ 2019-04-03 12:26 雨雪粪痘凯文 阅读(193) 评论(0) 推荐(0) 编辑
摘要: this.$options.methods.b();// b方法中 this underfine //方法一 this.$options.methods.b(this); b(e){ console.log(e.data) } //方法二 //或者 this.$options.methods.b.b 阅读全文
posted @ 2019-04-03 12:25 雨雪粪痘凯文 阅读(580) 评论(0) 推荐(0) 编辑
摘要: 子组件接收父组件的数据可以使用props和bind进行 父组件 <abc :mydata="data"></abc> //监听子组件触发的changeHi事件,然后调用changeHi方法 子组件: props:['cdata']//接收父组件传递 <div>{{cdata}}</div> 父组件要 阅读全文
posted @ 2019-04-03 12:24 雨雪粪痘凯文 阅读(148) 评论(0) 推荐(0) 编辑
摘要: .native给router 阅读全文
posted @ 2019-04-03 12:23 雨雪粪痘凯文 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 定义普通函数 A 在 A 中定义普通函数 B 在 A 中返回 B 执行 A,并把 A 的返回结果赋值给变量 C 执行 C 在 A 中定义普通函数 B 在 A 中返回 B 执行 A,并把 A 的返回结果赋值给变量 C 执行 C function A() { function B() { console 阅读全文
posted @ 2019-04-03 11:40 雨雪粪痘凯文 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Document.ready是 jQuery 中准备出发的事件,当加载到当前元素就执行了 Window.onload 是整个页面加载之后才执行 Document.ready是 jQuery 中准备出发的事件,当加载到当前元素就执行了 Window.onload 是整个页面加载之后才执行 阅读全文
posted @ 2019-04-03 11:40 雨雪粪痘凯文 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 数组 [] 对象 {} 字符串 ‘’ 布尔 true false undefined 空的变量 null 空的对象(typeof object) symbol(ES6新增,文章后面有对着新类型的解释)Symbol 生成一个全局唯一的值 数组 [] 对象 {} 字符串 ‘’ 布尔 true false 阅读全文
posted @ 2019-04-03 11:29 雨雪粪痘凯文 阅读(102) 评论(0) 推荐(0) 编辑
摘要: var e = [3, 1, 1, 2, 5, 4, 3, 2] function sort(e) { for (var i = 0; i < e.length - 1; i++) { for (var j = 0; j < e.length - 1 - i; j++) { if (e[j] > e 阅读全文
posted @ 2019-04-03 11:23 雨雪粪痘凯文 阅读(225) 评论(0) 推荐(0) 编辑