0.1.18 • Published 5 years ago
@hagan/vue-router v0.1.18
@hagan/vue-router
vue-router
简单版
开发
安装依赖
yarn install
开发环境
yarn serve
编译@hagan/vue-router
yarn build:rollup
使用方法
yarn add @hagan/vue-router
import Vue from 'vue'
import VueRouter from '@hagan/vue-router'
import App from '@/App.vue'
import Hagan from '@/views/Hagan.vue'
import Rita from '@/views/Rita.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/hagan',
component: Hagan
},
{
path: '/rita',
component: Rita
}
]
const router = new VueRouter({
mode: 'history',
routes
})
const vm = new Vue({
router,
render: h => h(App)
})
vm.$mount('#app')
App.vue
<template>
<div id="app">
<nav>
<router-link class="router-link" to="/hagan">hagan</router-link> |
<router-link class="router-link" to="/rita">rita</router-link> |
<router-link class="router-link" to="/rita/son">ritaSon</router-link>
</nav>
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style scoped>
#app {
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
.router-link {
color: #ccc;
font-size: 20px;
font-weight: 800;
}
.router-link-active {
color: #666;
}
.router-link-exact-active {
color: blue;
}
</style>
0.1.17
5 years ago
0.1.18
5 years ago
0.1.16
5 years ago
0.1.10
5 years ago
1.0.0
5 years ago
0.1.11
5 years ago
0.1.12
5 years ago
0.1.13
5 years ago
0.1.14
5 years ago
0.1.15
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.9
5 years ago
0.1.4
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.0
5 years ago