router setup
This commit is contained in:
parent
261f682b78
commit
4db224bc11
16
src/App.vue
16
src/App.vue
|
@ -4,26 +4,14 @@
|
||||||
import Greet from "./components/Greet.vue";
|
import Greet from "./components/Greet.vue";
|
||||||
import Navbar from "./components/Navbar.vue";
|
import Navbar from "./components/Navbar.vue";
|
||||||
import Camera from "./components/Camera.vue";
|
import Camera from "./components/Camera.vue";
|
||||||
|
import { RouterView } from "vue-router";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Navbar/>
|
<Navbar/>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid">
|
<RouterView/>
|
||||||
<div>
|
|
||||||
<Camera/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Camera/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Camera/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Camera/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="container">
|
<!-- <div class="container">
|
||||||
<h1>Welcome to Tauri!</h1>
|
<h1>Welcome to Tauri!</h1>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -15,14 +15,15 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<nav style="background-color: #011949; padding: 10px;">
|
<nav style="background-color: #011949; padding: 10px;">
|
||||||
<div style="display: flex; align-items: center;">
|
<div style="display: flex; align-items: center;">
|
||||||
<a href="#" style="text-decoration: none;">
|
<router-link to="/" style="text-decoration: none;">
|
||||||
<img src="../assets/NGCP.svg" alt="" width="40" height="24">
|
<img src="../assets/NGCP.svg" alt="" width="40" height="24">
|
||||||
<span style="font-weight: bold; font-size: 1.2rem; margin-left: 10px;">NG</span>
|
<span style="font-weight: bold; font-size: 1.2rem; margin-left: 10px;">NG</span>
|
||||||
<span style="font-weight: bold; font-size: 1.2rem; color: white">CP</span>
|
<span style="font-weight: bold; font-size: 1.2rem; color: white">CP</span>
|
||||||
</a>
|
</router-link>
|
||||||
<div style="width: 12rem; height:4rem;border: 2px solid rgb(52, 49, 49); background-color: rgb(255, 255, 255); margin-left: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
|
<div style="width: 12rem; height:4rem;border: 2px solid rgb(52, 49, 49); background-color: rgb(255, 255, 255); margin-left: auto; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
|
||||||
<div>
|
<div>
|
||||||
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Mission 1</span>
|
<span style="font-weight: bold; font-size: 1.2rem; color: rgb(0, 0, 0);">Mission 1</span>
|
||||||
|
@ -68,7 +69,7 @@ export default {
|
||||||
<!-- Insert your menu items here -->
|
<!-- Insert your menu items here -->
|
||||||
<li><a href="#" style="text-decoration: none;">Home</a></li>
|
<li><a href="#" style="text-decoration: none;">Home</a></li>
|
||||||
<li><a href="#" style="text-decoration: none;">Link</a></li>
|
<li><a href="#" style="text-decoration: none;">Link</a></li>
|
||||||
<li><a href="#" style="text-decoration: none;">Disabled</a></li>
|
<li><router-link to="/test" style="text-decoration: none;">Disabled</router-link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { createApp } from "vue";
|
import { createApp } from "vue";
|
||||||
import "./styles.css";
|
import "./styles.css";
|
||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
|
import router from "./router";
|
||||||
|
|
||||||
createApp(App).mount("#app");
|
createApp(App).use(router).mount("#app");
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { createRouter, createWebHashHistory } from "vue-router"
|
||||||
|
import fourCam from "../views/fourCam.vue";
|
||||||
|
import test from "../views/test.vue";
|
||||||
|
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{ path: '/', component: fourCam },
|
||||||
|
{ path: '/test', component: test },
|
||||||
|
]
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
|
// 4. Provide the history implementation to use. We
|
||||||
|
// are using the hash history for simplicity here.
|
||||||
|
history: createWebHashHistory(),
|
||||||
|
routes, // short for `routes: routes`
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
|
@ -0,0 +1,21 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import Camera from "../components/Camera.vue";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grid">
|
||||||
|
<div>
|
||||||
|
<Camera/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Camera/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Camera/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Camera/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grid">
|
||||||
|
<div>
|
||||||
|
<h1>
|
||||||
|
TESTESTES
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
Loading…
Reference in New Issue