Add router and basic home view
This commit is contained in:
parent
2342a99405
commit
4d718f9a12
4 changed files with 25 additions and 4 deletions
|
|
@ -1,14 +1,13 @@
|
|||
<template>
|
||||
<div id="app">
|
||||
<h1>{{ message }}</h1>
|
||||
<p>Count: {{ count }}</p>
|
||||
<button @click="increment">Increment</button>
|
||||
<RouterView />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from "vue";
|
||||
import { useHead } from "@vueuse/head";
|
||||
import { router } from "@/rmo/router";
|
||||
|
||||
const count = ref<number>(0);
|
||||
const message = ref<string>("hey");
|
||||
17
ts/rmo/router.ts
Normal file
17
ts/rmo/router.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { createRouter, createWebHistory } from "vue-router";
|
||||
import type { RouteRecordRaw } from "vue-router";
|
||||
import Home from "@/rmo/view/Home.vue";
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/",
|
||||
name: "Home",
|
||||
component: Home,
|
||||
},
|
||||
];
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHistory("/"),
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
3
ts/rmo/view/Home.vue
Normal file
3
ts/rmo/view/Home.vue
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<p>hey there!</p>
|
||||
</template>
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
import { createApp } from "vue";
|
||||
import { createHead } from "@vueuse/head";
|
||||
import App from "@/AppRMO.vue";
|
||||
import router from "@/rmo/router";
|
||||
import App from "@/rmo/App.vue";
|
||||
|
||||
const app = createApp(App);
|
||||
const head = createHead();
|
||||
|
||||
app.use(head);
|
||||
app.use(router);
|
||||
app.mount("#app");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue