路由(二) router-link的使用
main.js
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import footer from './components/footer.vue'
import header from './components/header.vue'
import body from './components/body.vue'
Vue.use(VueRouter);
let router=new VueRouter({
routes:[
{name:'footer',path:'/footer',component:footer},
{name:'header',path:'/header',component:header},
{name:'body',path:'/body',component:body}
]
})
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
app.vue
<template>
<div>
<!--留坑 非常重要-->
<router-view></router-view>
<router-link :to="{name:'header'}">header</router-link>
<router-link :to="{name:'footer'}">footer</router-link>
<router-link :to="{name:'body'}">body</router-link>
</div>
</template>
<script>
export default{
data(){
return{
msg:"这是一个aaa"
}
},
methods:{
}
}
</script>
<style>
</style>
路由(二) router-link的使用的更多相关文章
- 【react router路由】<Router> <Siwtch> <Route>标签
博客 https://www.jianshu.com/p/ed5e56994f13?from=timeline 文档 http://react-guide.github.io/react-router ...
- 基于gin的golang web开发:路由二
在基于gin的golang web开发:路由中我们介绍了Gin的路由和一些获取链接中参数的方法,本文继续介绍其他获取参数的方法. 文件上传 在web开发中文件上传是一个很常见的需求,下面我们来看一下基 ...
- ASP.NET MVC 路由(二)
ASP.NET MVC路由(二) 前言 在上一篇中,提及了Route.RouteCollection对象的一些信息,以及它们的结构所对应的关系.按照处理流程走下来还有遗留的疑问没有解决这个篇幅就来讲 ...
- Kendo UI 单页面应用(二) Router 类
Kendo UI 单页面应用(二) Router 类 Route 类负责跟踪应用的当前状态和支持在应用的不同状态之间切换.Route 通过 Url 的片段功能(#url)和流量器的浏览历史功能融合在一 ...
- vue路由请求 router
创建一个Router.js文件 // 路由请求//声明一个常量设置路菜单// import Vue from "vue/types/index";import Vue from ' ...
- 六、vue路由Vue Router
一.基本概念 route, routes, router 1, route,它是一条路由,由这个英文单词也可以看出来,它是单数, Home按钮 => home内容, 这是一条route, a ...
- [Redux] Navigating with React Router <Link>
We will learn how to change the address bar using a component from React Router. In Root.js: We need ...
- Vue.js 2.x笔记:路由Vue Router(6)
1. Vue Router简介与安装 1.1 Vue Router简介 Vue Router 是 Vue.js 官方的路由管理器.它和 Vue.js 的核心深度集成,构建单页面应用. Vue Rout ...
- 链接(跳转)<router-link> 和 路由实例Router
<router-link>和<router-link>传入的对象参数中包含path路径.name命名路由.params路径参数.query ?查询,并且如果提供了 path,p ...
- tinymce原装插件源码分析(二)-link
link 功能描述如下: 单纯放置光标: 1.如果光标放到了<a>上,读取a标签的内容,并弹框显示,确定的时候,更新当前a标签. 2.否则,就创建弹框,确定的时候,按照参数添加a标签. s ...
随机推荐
- Python爬虫教程-29-验证码识别-Tesseract-OCR
本篇是关于验证码识别问题,也是Python爬虫笔记的一个结尾,使用 Tesseract Python爬虫教程-29-验证码识别-Tesseract-OCR 常见反爬虫手段: 验证码 1.简单图片,扭曲 ...
- Python爬虫教程-14-爬虫使用filecookiejar保存cookie文件(人人网)
Python爬虫教程-14-爬虫使用filecookiejar保存cookie文件(人人网) 上一篇介绍了利用CookieJar访问人人网,本篇将使用filecookiejar将cookie以文件形式 ...
- Java Collections Framework知识结构目录
The core collection interfaces are the foundation of the Java Collections Framework. The Java Collec ...
- 【Leetcode】【Medium】Maximum Product Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
- 【Leetcode】【Medium】Find Minimum in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 migh ...
- linux中进入mysql时报错Access denied for user 'root'@'localhost' (using password: YES)解决方案
之前在linux中装完mysql后直接在命令行窗口输入mysql就会进入数据库了,但是今天输入mysql命令后直接报错,如下图: 之后输入:mysql -uroot -p 提示输入密码:***** 还 ...
- C++ 源代码到可执行代码的详细过程
编译,编译程序读取源程序(字符流),对之进行词法和语法的分析,将高级语言指令转换为功能等效的汇编代码,再由汇编程序转换为机器语言,并且按照操作系统对可执行文件格式的要求链接生成可执行程序. 源代码-- ...
- np.arrange用法
np.arange()经常用,其用法总结如下: np.arange(0,60,2) 生成从0到60的步距为2的数组,其中0为初始值,60为终值,2步距, np.arange(60) 生成从0到59的默 ...
- PAT-GPLT L3-017 森森快递(贪心 + 线段树)
链接: https://www.patest.cn/contests/gplt/L3-017 题意: 给出直线上的N个顶点,(N-1)条边的限制值(每对相邻的顶点之间都有一条边),以及Q个区间(给出起 ...
- im2rec 修改resize
https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.py#L196 源码是按照比例修改resize. 现在需要改一个自 ...