index.js,index.vue,course.vue,master.vue等

import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index'
import Course from '@/components/course'
import Master from '@/components/master'
Vue.use(Router) export default new Router({
routes: [
{
path: '/',
name: 'index',
component: Index
},
{
path: '/course',
name: 'course',
component: Course
},
{
path: '/master',
name: 'master',
component: Master
}
]
})
<template>
<div>
主页
</div>
</template> <script>
export default{
name:"index",
data(){
return{ }
}
}
</script> <style scoped> </style>
<template>
<div>
课程页面
</div>
</template> <script>
export default{
name:"course",
data(){
return{ }
}
}
</script> <style scoped> </style>
<template>
<div>
<ul>
<li>
<router-link to="/">首页</router-link>
</li>
<li>
<router-link to="/course">课程</router-link>
</li>
<li>
<router-link to="/master">专家</router-link>
</li>
</ul>
</div>
</template> <script>
export default{
name:"navlist",
data(){
return{ }
}
}
</script> <style scoped>
a{
text-decoration: none;
color: #;
}
div{
width: %;
height: 50px;
background: #F1F1F1;
line-height: 50px;
}
ul{
list-style: none;
}
ul li{
float: left;
margin: 20px;
}
</style>

效果图

vue路由DEMO的更多相关文章

  1. vue 路由demo

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 一个基于ES6+webpack的vue小demo

    上一篇文章<一个基于ES5的vue小demo>我们讲了如何用ES5,vue-router做一个小demo,接下来我们来把它变成基于ES6+webpack的demo. 一.环境搭建及代码转换 ...

  3. 一个基于ES5的vue小demo

    由于现在很多vue项目都是基于ES6开发的,而我学vue的时候大多是看vue官网的API,是基于ES5的,所以对于刚接触项目的我来说要转变为项目的模块化写法确实有些挑战.因此,我打算先做一个基于ES5 ...

  4. Vue 路由详解

    Vue 路由详解 对于前端来说,其实浏览器配合超级连接就很好的实现了路由功能.但是对于单页面应用来说,浏览器和超级连接的跳转方式已经不能适用,所以各大框架纷纷给出了单页面应用的解决路由跳转的方案. V ...

  5. Vue路由(vue-router)详细讲解指南

    中文文档:https://router.vuejs.org/zh/ Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,让构建单页面应用变得易如反掌.路由实际 ...

  6. --@angularJS--一个简单的UI-Router路由demo

    1.index.html: <!DOCTYPE HTML><html ng-app="routerApp"><head>    <titl ...

  7. Vue路由vue-router

    前面的话 在Web开发中,路由是指根据URL分配到对应的处理程序.对于大多数单页面应用,都推荐使用官方支持的vue-router.Vue-router通过管理URL,实现URL和组件的对应,以及通过U ...

  8. 攻克vue路由

    先下手 路由是个好功能,但是每次都感觉没法开始下手,愣愣的看半天官方文档,所以做个快速开始教程. 首先先搭好HTML文件结构: <!--link和view在一个父元素下--> <di ...

  9. Vue路由学习心得

    GoodBoy and GoodGirl~进来了就看完点个赞再离开,写了这么多也不容易的~ 一.介绍  1.概念:路由其实就是指向的意思,当我们点击home按钮时,页面中就要显示home的内容,点击l ...

随机推荐

  1. group by 和count的联合使用问题 [转]

    group by 和count的联合使用问题 今天写查询语句遇到一个问题,就是用group by进行分组以后,用count统计分组以后的个数, 开始写的语句大体是: select count(m.fb ...

  2. 校园社交网站app

    1.项目说明 1.1 项目背景 虽然公共社交网络系统能够满足大多数高校校园用户在校园网络社交的需求,但是针对校园学习.工作和文化生活等方面的支持以及学校个性化需求方面却存在不足.利用电子校务平台的数据 ...

  3. 【Leetcode】222. Count Complete Tree Nodes

    Question: Given a complete binary tree, count the number of nodes. Definition of a complete binary t ...

  4. helm 替换源的方法

    网上找了一个 helm 替换源的方法 挺好用的 mark 一下 helm repo remove stable helm repo add stable https://kubernetes.oss- ...

  5. Oracle 标准版 企业版 个人版的区别 转帖

    转帖来源: https://blog.csdn.net/flg_inwind/article/details/2628133 同事方总:http://www.oracle.com/us/corpora ...

  6. 防止短时间js 重复执行

    function debounce(fn, delay) { // 持久化一个定时器 timer let timer = null; // 闭包函数可以访问 timer return function ...

  7. BZOJ4589 Hard Nim(博弈+FWT)

    即使n个数的异或为0.如果只有两堆,将质数筛出来设为1,做一个异或卷积即可.显然这个东西满足结合律,多堆时直接快速幂.可以在点值表示下进行. #include<iostream> #inc ...

  8. Merkle Tree 概念

    Merkle Tree 概念 来源 https://www.cnblogs.com/fengzhiwu/p/5524324.html /*最近在看Ethereum,其中一个重要的概念是Merkle T ...

  9. mysql 分组取每个组的前几名的问题

    select *from hotel_addition_orders awhere (select count(*) from hotel_addition_orders where hotel_or ...

  10. HGOI20180823 三校联考

    首测:220qwq(算差的好吧) 后来改了一个地方:300qwq(算慢的好吧) std被踩qwq 注意:输入数据第一行忘记输入n,亲脑补 题解: 多项式除法(若最后除出的答案为1那么就是成功),对于f ...