1. javascript 호출
<script src="https://unpkg.com/vue-router"></script>
2. vue router 선언
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
3. 기본 사용
import home from './components/home';
import about from './components/about';
const router = new VueRouter ({
routes: [
{
path: '/',
component: home
},
{
}
]
});
4. parameter
const user = {
props: ['userid'],
template: '<p> user id: {{ userid }} </p>'
};
const router = new VueRouter({
routes: [
path: '/user/:userid',
component: user,
props: true
]
});
'기타' 카테고리의 다른 글
ansible 소스 설치 (0) | 2019.09.12 |
---|---|
node js gc (0) | 2019.05.19 |
rsync 사용 (0) | 2019.02.11 |
node.js 설치 (0) | 2018.11.26 |
telegraf 설정 예제 (0) | 2018.07.13 |