摘要: 1.router-link-exact-active 精准匹配 2.router-link-active 匹配 配置: import Vue from 'vue'import VueRouter from 'vue-router'//@表示寻找根目录import HelloWorld from '@ 阅读全文
posted @ 2019-08-11 23:38 星雨,恒奋斗,过客 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 1.重定向 2.404 3.mode:"history" 4.this.$route.path 实例 import Vue from 'vue'import VueRouter from 'vue-router'//@表示寻找根目录import HelloWorld from '@/componen 阅读全文
posted @ 2019-08-11 21:49 星雨,恒奋斗,过客 阅读(127) 评论(0) 推荐(0) 编辑
摘要: App.vue <template> <div id="app"> <img src="./assets/logo.png"> <ul> <!-- <router-link to="/h" tag="li">HelloWorld</router-link> <router-link to="/lea 阅读全文
posted @ 2019-08-11 21:29 星雨,恒奋斗,过客 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1.router.push 想要导航到不同的 URL,则使用 router.push 方法。这个方法会向 history 栈添加一个新的记录,所以,当用户点击浏览器后退按钮时,则回到之前的 URL。 2.router.replace 跟 router.push 很像,唯一的不同就是,它不会向 his 阅读全文
posted @ 2019-08-11 19:31 星雨,恒奋斗,过客 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1.动态路由(参数传递) /:id 2.路由嵌套 import Vue from 'vue'import VueRouter from 'vue-router'//@表示寻找根目录import HelloWorld from '@/components/HelloWorld'import learn 阅读全文
posted @ 2019-08-11 19:07 星雨,恒奋斗,过客 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 1.单独的设置路由的index.js import Vue from 'vue'import VueRouter from 'vue-router'//@表示寻找根目录import HelloWorld from '@/components/HelloWorld'import learn from 阅读全文
posted @ 2019-08-11 18:27 星雨,恒奋斗,过客 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 1.路由注意2.安装npm install vue-router --save3.在项目中使用它,明确的通过Vue.use()安装路由功能import VueRouter from 'vue-router'Vue.use(VueRouter)4.创建路由//创建路由const router=new 阅读全文
posted @ 2019-08-11 13:11 星雨,恒奋斗,过客 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1.跨域配置 proxyTable: { '/xxx_api':{ target: 'http://xxxcom', pathRewrite: { '^/xxx_api': '' }, changeOrigin: true } } mains.js Vue.prototype.HOST = "/xx 阅读全文
posted @ 2019-08-11 02:51 星雨,恒奋斗,过客 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 1.全局配置 axios.defaults.baseURL = 'https://api.example.com'; axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; axios.defaults.headers.post['C 阅读全文
posted @ 2019-08-11 01:01 星雨,恒奋斗,过客 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 1.axios-post请求 <template lang="html"> <div class="hello"> HelloWorld! </div></template> <script> import qs from "qs"; // 解决参数格式的转码问题 ?name=xxxxx&age=1 阅读全文
posted @ 2019-08-11 00:43 星雨,恒奋斗,过客 阅读(139) 评论(0) 推荐(0) 编辑
摘要: _axios: vue >axios(网络请求) Axios是一个基于promise的HTTP库,可以用在浏览器和node.js中。 安装 npm install axios --save 引入: import axios from 'axios' Vue.prototype.$axios=Axio 阅读全文
posted @ 2019-08-11 00:22 星雨,恒奋斗,过客 阅读(171) 评论(0) 推荐(0) 编辑