标签:link return back ret order red name router size
router.js:
import Vue from ‘vue‘
import Router from ‘vue-router‘
import Home from ‘@/components/Home‘
import HelloWorld from ‘@/components/HelloWorld‘
Vue.use(Router)
export default new Router({
routes: [
{
path: ‘/Home‘,
component: Home
},
{
path: ‘/HelloWorld‘,
component: HelloWorld
},
{
path: ‘/‘,
redirect: ‘/Home‘
}
]
})
Home.vue:
<template>
<div class="home">
<h1>{{ msg }}</h1>
<router-link to="/">Home</router-link>
<router-link to="/HelloWorld">HelloWorld</router-link>
</div>
</template>
<script>
export default {
name: ‘Home‘,
data () {
return {
msg: ‘Home‘
}
}
}
</script>
<style></style>
HelloWorld.vue:
<template>
<div class="HelloWorld">
<h1>{{ msg }}</h1>
<router-link to="/">Home</router-link>
<router-link to="/HelloWorld">HelloWorld</router-link>
</div>
</template>
<script>
export default {
name: ‘HelloWorld‘,
data () {
return {
msg: ‘HelloWorld‘
}
}
}
</script>
<style></style>
标签:link return back ret order red name router size
原文地址:https://www.cnblogs.com/shirliey/p/9674644.html