generated from common/vue-front
初始化以适应本项目
This commit is contained in:
parent
f2aa206bcd
commit
f3fece7b5f
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<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">
|
||||
<title>Vite App</title>
|
||||
</head>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
BIN
public/logo.png
Normal file
BIN
public/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.7 KiB |
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.7 KiB |
@ -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 |
@ -1,11 +0,0 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup name="BasicLayout">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -3,9 +3,17 @@ import './assets/main.css'
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
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)
|
||||
|
||||
app.use(router)
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component)
|
||||
}
|
||||
|
||||
app.use(ElementPlus)
|
||||
app.mount('#app')
|
||||
|
@ -1,24 +1,14 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import BasicLayout from '@/components/layouts/BasicLayout.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Basic',
|
||||
component: BasicLayout,
|
||||
meta: { title: '主页' },
|
||||
redirect: '/home',
|
||||
children: [
|
||||
{
|
||||
path: '/home',
|
||||
name: 'Home',
|
||||
meta: { title: '主页', icon: '', activeIndex: 'home' },
|
||||
component: () => import('../views/Home.vue')
|
||||
},
|
||||
]
|
||||
}
|
||||
name: 'Home',
|
||||
meta: { title: '主页', icon: '', activeIndex: 'home' },
|
||||
component: () => import('@/views/Home.vue'),
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
|
21
src/store/store.js
Normal file
21
src/store/store.js
Normal 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
|
@ -19,16 +19,24 @@ export default defineConfig(({ mode, command }) => {
|
||||
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue']
|
||||
},
|
||||
server: {
|
||||
port: 7777,
|
||||
port: 3500,
|
||||
host: true,
|
||||
open: true,
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
target: 'http://localhost:6789',
|
||||
// target: 'http://117.62.238.129:6789',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
'/api': {
|
||||
// target: 'http://117.62.238.129:10050',
|
||||
target: 'http://192.168.50.101:10050',
|
||||
// target: 'http://10.70.132.177:11002',
|
||||
ws: false,
|
||||
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
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user