摘要:
解构数组进行变量值的替换 / bad let a = 1, b = 2 let temp = a a = b b = temp // good let a = 1, b = 2 [b, a] = [a, b] .解构对象 // bad setForm (person) { this.name = p 阅读全文
摘要:
vue中echart图标配置相关案例 阅读全文
摘要:
router.beforeEach((to, from, next) => { // ... }) 在路由守卫中,只有next()是放行,其他的诸如:next('/logon') 、 next(to) 或者 next({ ...to, replace: true })都不是放行,而是:中断当前导航, 阅读全文
摘要:
const whiteList = ['/login', '/auth-redirect', '/bind', '/register'] router.beforeEach((to, from, next) => { const token = sessionStorage.getItem('acc 阅读全文
摘要:
效果如下 点击按钮 添加一个新的表单 提交时进行验证 上代码 <el-form-item label="申报限制" v-for="(item,index) in form.boundTabs" :key="index" :prop="'boundTabs['+index+'].bound'" :ru 阅读全文
摘要:
//$router : 是路由操作对象,只写对象 //$route : 路由信息对象,只读对象 //操作 路由跳转 this.$router.push({ name:'hello', params:{ name:'word', age:'11' } }) //读取 路由参数接收 this.name 阅读全文
摘要:
总体来讲vue里面提供了三大类钩子1、全局钩子2、某个路由的钩子(路由独享)3、组件内钩子(组件独享) 两种函数: 1、 Vue.beforeEach(function(to,form,next){}) /*在跳转之前执行*/ 2 .Vue.afterEach(function(to,form))/ 阅读全文
摘要:
axios是一个基于Promise的HTTP库 可以用在浏览器和Node.js中。 模块化开发 使用npm安装方式 npm install axios 在vue脚手架项目中使用 可以再main.js文件中导入axios 并绑定到vue的原型链上 代码如下: import Vue from 'vue' 阅读全文