add: добавлен роутер

This commit is contained in:
mfnefd 2024-12-02 23:44:01 +04:00
parent ae0db073a2
commit bc5992552a
6 changed files with 869 additions and 6 deletions

846
front/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,13 +10,16 @@
"gen-api": "swagger-typescript-api -r -o ./src/core/api/ --modular -p " "gen-api": "swagger-typescript-api -r -o ./src/core/api/ --modular -p "
}, },
"dependencies": { "dependencies": {
"ant-design-vue": "^4.2.6",
"vue": "^3.5.12", "vue": "^3.5.12",
"vue-router": "^4.5.0",
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^5.1.4", "@vitejs/plugin-vue": "^5.1.4",
"swagger-typescript-api": "^13.0.23", "swagger-typescript-api": "^13.0.23",
"typescript": "~5.6.2", "typescript": "~5.6.2",
"unplugin-vue-components": "^0.27.5",
"vite": "^5.4.10", "vite": "^5.4.10",
"vue-tsc": "^2.1.8" "vue-tsc": "^2.1.8"
} }

View File

@ -5,7 +5,7 @@ import Header from './components/main/Header.vue';
<template> <template>
<Header /> <Header />
<main> <main>
test <RouterView />
</main> </main>
</template> </template>

View File

@ -0,0 +1,11 @@
<script setup lang="ts">
</script>
<template>
test!
</template>
<style scoped>
</style>

View File

@ -2,9 +2,11 @@ import { createApp } from 'vue'
import './style.css' import './style.css'
import App from './App.vue' import App from './App.vue'
import { key, store } from './store' import { key, store } from './store'
import router from './router'
const app = createApp(App) const app = createApp(App)
app.use(store, key) app.use(store, key)
app.use(router)
app.mount('#app') app.mount('#app')

11
front/src/router.ts Normal file
View File

@ -0,0 +1,11 @@
import { createRouter, createWebHistory } from 'vue-router';
export default createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
component: () => import('./components/pages/Home.vue'),
}
],
})