Vue
ggmshm
前端慢慢爬
展开
-
Vue.js——全局守卫
全局守卫const routes=[ {path:'/',name:"homeLink",component:Home}, {path:'/menu',component:Menu}, {path:'*',redirect:'/'}]const router=new VueRouter({ routes, mode:"history"})router.beforeEach...原创 2019-07-18 09:54:45 · 698 阅读 · 0 评论 -
Vue.js——路由2 复用路由
在routes.js 配置路由中 将 component 改为 componentsexport const routes=[ {path:'/',name:"homeLink",components:{ default:Home, 'orderingGuide':OrderingGuide, 'delivery':Delivery, 'history':History...原创 2019-07-18 10:13:00 · 976 阅读 · 0 评论 -
Vue.js准备工作1
有时间整理一下Vue的初始操作 如下首先cmd一下 ->检查node版本号(木有安装移步node相关博客)node -v接下来就是搭建脚手架全局安装vue-clinpm install --global vue-cli创建一个项目vue init webpack vue-playlist //或者简单版本vue init webpack-simple v...原创 2019-07-17 11:11:36 · 76 阅读 · 0 评论 -
Vue.js——路由1
使用路由,首先要下载路由 进入cmd然后层层进入项目npm install vue-router --save重新运行一下npm run dev准备工作做好了 接下来在main.js中配置一下你的路由信息// 引入路由import VueRouter from 'vue-router'// 引入跳转的目标文件 这里用的都是组件import Home from './...原创 2019-07-17 14:22:44 · 153 阅读 · 0 评论