init: 初始化 vue 项目

frontend/dev
Spark 2 months ago
parent 69574ea64b
commit c651874a8f

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo

@ -0,0 +1,9 @@
<script setup>
</script>
<template>
<router-view></router-view>
</template>
<style>
</style>

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./src/assets/duck.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://www.aspark.cc/live2d/css/pio.css" rel="stylesheet" type="text/css" />
<title>YaYa点名</title>
<style>
#pio-container {
position: fixed !important;
left: 0 !important;
bottom: 0 !important;
z-index: 1000;
display: flex !important;
align-items: flex-end !important;
pointer-events: auto;
cursor: grab !important;
}
#pio-container:active {
cursor: grabbing !important;
}
#pio {
width: 20vw !important;
height: 20vw !important;
min-width: 120px !important;
min-height: 120px !important;
max-width: 200px !important;
max-height: 200px !important;
pointer-events: auto;
}
.pio-action {
width: auto !important;
height: auto !important;
bottom: 75% !important;
/* 垂直居中 */
left: 100% !important;
/* 向右侧偏移 */
transform: translateY(50%) scale(0.75);
/* 垂直居中,缩放 */
transform-origin: left center;
/* 缩放的基点设置为左侧中心 */
display: flex !important;
flex-direction: column !important;
pointer-events: auto;
}
.pio-action .pio-home {
display: none !important;
}
.pio-action .pio-close {
display: none !important;
}
.pio-action .pio-skin {
display: none !important;
}
.pio-action .pio-info {
display: none !important;
}
.pio-action span {
margin: 2px 0 !important;
width: 30px !important;
height: 30px !important;
min-width: 20px !important;
min-height: 20px !important;
background-size: contain !important;
background-repeat: no-repeat !important;
pointer-events: auto;
}
@media (max-width: 768px) {
.pio-action span {
width: 25px !important;
height: 25px !important;
}
}
@media (max-width: 480px) {
.pio-action span {
width: 20px !important;
height: 20px !important;
}
}
</style>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script src="https://www.aspark.cc/live2d/js/TweenLite.js"></script>
<script src="https://www.aspark.cc/live2d/js/live2dcubismcore.min.js"></script>
<script src="https://www.aspark.cc/live2d/js/pixi.min.js"></script>
<script src="https://www.aspark.cc/live2d/js/cubism4.min.js"></script>
<script src="https://www.aspark.cc/live2d/js/pio.js"></script>
<script src="https://www.aspark.cc/live2d/js/pio_sdk4.js"></script>
<script src="https://www.aspark.cc/live2d/js/load.js"></script>
</body>
</html>

@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}

@ -0,0 +1,29 @@
import '@/assets/main.scss'
import '@/assets/icons/iconfont.css'
import '@/assets/fonts/fonts.css'
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import router, {setupRouterGuard} from "@/router/index.js";
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import { createPinia } from 'pinia';
import { createPersistedState } from "pinia-persistedstate-plugin";
const app = createApp(App)
const pinia = createPinia()
const persist = createPersistedState()
pinia.use(persist)
app.use(ElementPlus, {locale: zhCn})
app.use(router)
app.use(pinia)
setupRouterGuard(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.mount('#app')

File diff suppressed because it is too large Load Diff

@ -0,0 +1,28 @@
{
"name": "test",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"axios": "^1.7.7",
"dayjs": "^1.11.13",
"element-plus": "^2.8.4",
"pinia": "^2.2.4",
"pinia-persistedstate-plugin": "^0.1.0",
"vue": "^3.4.29",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.5",
"less": "^4.2.0",
"saas": "^1.0.0",
"sass-embedded": "^1.79.4",
"vite": "^5.3.1"
}
}

@ -0,0 +1,25 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
})
Loading…
Cancel
Save