初始化以适应本项目

This commit is contained in:
huangge1199 2024-05-15 11:15:11 +08:00
parent f2aa206bcd
commit f3fece7b5f
10 changed files with 49 additions and 34 deletions

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title> <title>Vite App</title>
</head> </head>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>

Before

Width:  |  Height:  |  Size: 276 B

View File

@ -1,11 +0,0 @@
<template>
</template>
<script setup name="BasicLayout">
</script>
<style scoped>
</style>

View File

@ -3,9 +3,17 @@ import './assets/main.css'
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App) const app = createApp(App)
app.use(router) app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.use(ElementPlus)
app.mount('#app') app.mount('#app')

View File

@ -1,24 +1,14 @@
import { createRouter, createWebHashHistory } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router'
import BasicLayout from '@/components/layouts/BasicLayout.vue'
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(), history: createWebHashHistory(),
routes: [ routes: [
{ {
path: '/', path: '/',
name: 'Basic', name: 'Home',
component: BasicLayout, meta: { title: '主页', icon: '', activeIndex: 'home' },
meta: { title: '主页' }, component: () => import('@/views/Home.vue'),
redirect: '/home', },
children: [
{
path: '/home',
name: 'Home',
meta: { title: '主页', icon: '', activeIndex: 'home' },
component: () => import('../views/Home.vue')
},
]
}
] ]
}) })

21
src/store/store.js Normal file
View File

@ -0,0 +1,21 @@
import { createStore } from 'vuex'
const store = createStore({
state() {
return {
currentRoute: null
}
},
mutations: {
setCurrentRoute(state, route) {
state.currentRoute = route
}
},
getters: {
currentRoute(state) {
return state.currentRoute
}
}
})
export default store

View File

@ -19,16 +19,24 @@ export default defineConfig(({ mode, command }) => {
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
}, },
server: { server: {
port: 7777, port: 3500,
host: true, host: true,
open: true, open: true,
proxy: { proxy: {
// https://cn.vitejs.dev/config/#server-proxy '/api': {
'/dev-api': { // target: 'http://117.62.238.129:10050',
target: 'http://localhost:6789', target: 'http://192.168.50.101:10050',
// target: 'http://117.62.238.129:6789', // target: 'http://10.70.132.177:11002',
changeOrigin: true, ws: false,
rewrite: (p) => p.replace(/^\/dev-api/, '') changeOrigin: true
},
'/poll': {
// target: 'http://117.62.238.129:6066',
target: 'http://192.168.50.101:6066',
// target: 'http://10.70.132.177:11002',
pathRewrite: { '^/poll': '' },
ws: false,
changeOrigin: true
} }
} }
}, },