12 2020 档案

摘要:1.安装:npm install axios --save 2.引入:import axios from 'axios' 3.基本使用: //默认是GET请求axios({ url:'api' }).then((res)=>{ console.log(res) }) 4.处理多个并发使用axios. 阅读全文
posted @ 2020-12-29 16:06 银河游鱼 阅读(114) 评论(0) 推荐(0) 编辑
摘要:1.需求,获取多个异步执行函数的结果。 2.用法: var p1 = new Promise((resolve, reject) => { setTimeout(() => resolve('one'), 1000); }); var p2 = new Promise((resolve, rejec 阅读全文
posted @ 2020-12-25 11:07 银河游鱼 阅读(554) 评论(0) 推荐(0) 编辑
摘要:在用vue-router 做单页应用的时候重复点击一个跳转的路由会出现报错 这个报错是重复路由引起的只需在注册路由组建后使用下方重写路由就可以 解决办法: const originalReplace = Router.prototype.replace; Router.prototype.repla 阅读全文
posted @ 2020-12-22 14:09 银河游鱼 阅读(114) 评论(0) 推荐(0) 编辑
摘要:1.在router的index.js配置映射关系中添加meta:{title:'首页'}; { path:'/profile', component:Profile, meta:{ title:'个人' } 2、使用 router.beforeEach方法: router.beforeEach( ( 阅读全文
posted @ 2020-12-11 11:31 银河游鱼 阅读(120) 评论(0) 推荐(0) 编辑
摘要:1、 2、使用: 阅读全文
posted @ 2020-12-09 17:03 银河游鱼 阅读(593) 评论(0) 推荐(0) 编辑
摘要:1.在路由配置页面中引入组件。 2、在要对应的配置页面中添加映射关系: const routes = [ { path:'', //redirect重定向,默认打开的路径 redirect:'/home' }, { path:'/home', component:Home, children:[{ 阅读全文
posted @ 2020-12-09 14:14 银河游鱼 阅读(201) 评论(0) 推荐(0) 编辑
摘要:1.不使用路由懒加载: import Home from '../components/Home' import About from '../components/About' import User from '../components/User' 2、使用路由懒加载: //路由懒加载的方式加 阅读全文
posted @ 2020-12-09 13:25 银河游鱼 阅读(150) 评论(1) 推荐(0) 编辑
摘要:1.在router配置映射关系的文件中 添加动态属性: 2、使用 router-link绑定动态路由属性; 3、在页面中获取路由的动态属性: 阅读全文
posted @ 2020-12-07 16:05 银河游鱼 阅读(672) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示