随笔分类 - VUE
摘要://第一种调用方式 new Promise((resolve,reject)=>{ setTimeout(function() { console.log('模拟异步请求操作!'); //resolve('成功时主动调用这个函数,会执行下面的then方法') // reject('失败时主动调用这个
阅读全文
摘要:router.beforeEach((to,from,next)=>{ //从from跳转到to document.title=to.matched[0].meta.title console.log(to) next() //这步必须要调用 }) //后置钩子 router.afterEach((
阅读全文
摘要:import Vue from 'vue' import Router from 'vue-router' Router.prototype.go = function(t) { this.isBack = true console.log('go ' + this.history.current.
阅读全文
摘要:npm install --save-dev vue-loader vue-template-compiler 打开 webpack.config.js文件添加配置信息 module.exports={ entry:'/src/main.js',//入口文件 output:{filename:'bu
阅读全文
摘要:npm install webpack@3.6.0 --save-dev
阅读全文