0.1.18 • Published 3 years ago

@hagan/vue-router v0.1.18

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

@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

3 years ago

0.1.18

3 years ago

0.1.16

3 years ago

0.1.10

4 years ago

1.0.0

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago