Install and initialize vue router

This commit is contained in:
rijkvanzanten
2020-02-05 15:37:14 -05:00
parent 55e56e30ec
commit 9c3cd2e0c3
6 changed files with 22 additions and 21 deletions

View File

@@ -1,16 +0,0 @@
<template>
<div>
<h1>Hello, world!</h1>
<p>{{ date }}</p>
</div>
</template>
<script lang="ts">
import { createComponent } from '@vue/composition-api';
export default createComponent({
setup() {
const date = new Date();
return { date };
}
});
</script>

View File

@@ -1,14 +1,18 @@
import Vue from 'vue';
import VueCompositionAPI from '@vue/composition-api';
import VueRouter from 'vue-router';
import router from './router';
import './styles/main.scss';
import App from './app.vue';
Vue.use(VueCompositionAPI);
Vue.use(VueRouter);
Vue.config.productionTip = false;
const app = new Vue({
render: h => h(App)
render: h => h('router-view'),
router
}).$mount('#app');
export default app;

9
src/router.ts Normal file
View File

@@ -0,0 +1,9 @@
import VueRouter from 'vue-router';
const router = new VueRouter();
export function useRouter() {
return router;
}
export default router;

3
src/views/readme.md Normal file
View File

@@ -0,0 +1,3 @@
# Views
Views are the top-level parent component that are used in all modules. Directus will only have two Views for the foreseeable future: `public` and `private` for non-authenticated and authenticated routes respectively