feat: 初次提交

This commit is contained in:
Fromsko 2024-09-10 10:09:15 +08:00
parent e1257bbaa2
commit de1dd98c7f
42 changed files with 16743 additions and 8 deletions

35
.gitignore vendored
View File

@ -1,11 +1,30 @@
# ---> Vue
# gitignore template for Vue.js projects
#
# Recommended template: Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# TODO: where does this rule come from?
docs/_book
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
# TODO: where does this rule come from?
test/
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo

3
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}

BIN
bun.lockb Normal file

Binary file not shown.

16
index.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue 管理系统</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

36
package.json Normal file
View File

@ -0,0 +1,36 @@
{
"name": "demo",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
"type-check": "vue-tsc --build --force"
},
"dependencies": {
"axios": "^1.7.7",
"element-plus": "^2.8.2",
"pinia": "^2.1.7",
"vue": "^3.4.29",
"vue-router": "^4.3.3"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.4",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.14.5",
"@vitejs/plugin-vue": "^5.0.5",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"jsdom": "^24.1.0",
"npm-run-all2": "^6.2.0",
"sass-embedded": "^1.78.0",
"typescript": "~5.4.0",
"vite": "^5.3.1",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.21"
}
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

15
src/App.vue Normal file
View File

@ -0,0 +1,15 @@
<template>
<router-view></router-view>
</template>
<script>
export default {
name: 'app',
}
</script>
<style lang="sass">
@import "@/assets/style/reset.css"
@import "@/assets/style/oneui.css"
@import "@/assets/style/index.scss"
</style>

86
src/assets/base.css Normal file
View File

@ -0,0 +1,86 @@
/* color palette from <https://github.com/vuejs/theme> */
:root {
--vt-c-white: #ffffff;
--vt-c-white-soft: #f8f8f8;
--vt-c-white-mute: #f2f2f2;
--vt-c-black: #181818;
--vt-c-black-soft: #222222;
--vt-c-black-mute: #282828;
--vt-c-indigo: #2c3e50;
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
--vt-c-text-light-1: var(--vt-c-indigo);
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
--vt-c-text-dark-1: var(--vt-c-white);
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
}
/* semantic color variables for this project */
:root {
--color-background: var(--vt-c-white);
--color-background-soft: var(--vt-c-white-soft);
--color-background-mute: var(--vt-c-white-mute);
--color-border: var(--vt-c-divider-light-2);
--color-border-hover: var(--vt-c-divider-light-1);
--color-heading: var(--vt-c-text-light-1);
--color-text: var(--vt-c-text-light-1);
--section-gap: 160px;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: var(--vt-c-black);
--color-background-soft: var(--vt-c-black-soft);
--color-background-mute: var(--vt-c-black-mute);
--color-border: var(--vt-c-divider-dark-2);
--color-border-hover: var(--vt-c-divider-dark-1);
--color-heading: var(--vt-c-text-dark-1);
--color-text: var(--vt-c-text-dark-2);
}
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
font-weight: normal;
}
body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition:
color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family:
Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

BIN
src/assets/images/404.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
src/assets/images/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

1
src/assets/logo.svg Normal file
View File

@ -0,0 +1 @@
<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>

After

Width:  |  Height:  |  Size: 276 B

34
src/assets/main.css Normal file
View File

@ -0,0 +1,34 @@
@import './base.css';
#app {
margin: 0 auto;
padding: 2rem;
font-weight: normal;
}
a,
.green {
text-decoration: none;
color: hsla(160, 100%, 37%, 1);
transition: 0.4s;
padding: 3px;
}
@media (hover: hover) {
a:hover {
background-color: hsla(160, 100%, 37%, 0.2);
}
}
@media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}

View File

@ -0,0 +1,77 @@
html,
body {
height: 100%;
width: 100%;
}
*:not([class^='el-']) {
box-sizing: border-box;
}
.white {
background-color: aliceblue;
}
a {
text-decoration: none;
}
.gray {
background-color: #eef0f3;
}
.mr10 {
margin-right: 10px;
}
.mr20 {
margin-right: 20px;
}
.m-lr10{
margin-left: 10px;
margin-right: 10px;
}
.p20{
padding: 20px;
}
.pl20{
padding-left: 20px;
}
.fr{
float: right;
}
.text-right {
text-align: right;
}
.flex{
display: flex;
}
.flex-between{
display: flex;
justify-content: space-between;
}
.flex-center {
display: flex;
justify-content: center;
}
.tips {
margin-left: 15px;
color: #787878;
}
// 公共样式
.query-form {
background-color: #ffffff;
padding: 22px 20px 0px;
border-radius: 5px;
}
.base-table {
border-radius: 5px;
background: #ffffff;
margin-top: 20px;
margin-bottom: 20px;
.action{
border-radius: 5px 5px 0px 0px;
background: #ffffff;
padding: 20px;
border-bottom: 1px solid #ece8e8;
}
.pagination {
text-align: right;
padding: 10px;
}
}

890
src/assets/style/nav.css Normal file
View File

@ -0,0 +1,890 @@
.p_top {
text-align: center;
background-color: #5eaefc;
color: #fff;
padding: 5px;
}
.int {
max-width: 60%;
width: 450px;
height: 30px;
margin-bottom: 10px;
border: 1px solid #4bb3ea;
font-size: 14px;
font-family: 寰î¿èéå´ç²¦;
font-weight: 500;
padding-left: 10px;
}
.fk_service {
max-height: 232px;
position: fixed;
right: 10px;
top: 65%;
/* 鍨傜洿浣嶇疆 */
font-family: 'FontAwesome';
font-size: 14px;
color: #243558;
z-index: 10000
}
.fk_service ul {
margin: 0;
padding: 0;
position: absolute;
right: 0
}
.fk_service li {
list-style-type: none
}
.fk_service li>div {
box-sizing: border-box;
box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1)
}
.fk_service_box {
width: 40px;
height: 40px;
background: #fff;
margin-bottom: 10px;
border-radius: 4px;
box-sizing: border-box;
box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.1)
}
.fk_service_triangle {
top: 12px;
right: -11px;
position: absolute;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
border-left: 11px solid #e1e6ec;
z-index: 1010
}
.fk_service_triangle:after {
content: "\20";
top: -6px;
right: 1px;
position: absolute;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 10px solid #fff;
z-index: 1000
}
.fk_service_triangle:before {
content: "\20";
width: 80px;
height: 45px;
top: -20px;
right: -52px;
position: absolute;
background: rgba(0, 0, 0, 0)
}
@keyframes fade-in {
0% {
opacity: .4;
right: 82px
}
100% {
opacity: 1;
right: 62px
}
}
.fk_service_consult {
background: url(../images/20190827-5d652476ab305.png) no-repeat -366px -16px #fff
}
.fk_service_consult:hover {
border: 0;
background: url(../images/20190827-5d652476ab305.png) no-repeat -410px -16px #4f7cfc
}
.fk_service_consult:hover .fk_service_consult_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_consult_cont {
width: 200px;
min-height: 210px;
max-height: 268px;
border-radius: 3px;
background: #fff;
right: 62px;
position: absolute;
text-align: center;
border: 1px solid #e1e6ec;
display: none;
opacity: 0
}
.fk_service_consult_cont1 {
width: 70px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
.fk_service_consult_cont1 .fk_service_triangle:before {
width: 0 !important
}
.fk_service_consult_cont>.fk_service_triangle:after {
border-left: 10px solid #f6f8fb !important
}
.fk_service_consult_cont span {
float: left
}
.fk_service_consult_cont_top {
width: 100%;
height: 157px;
background: #f6f8fb;
border-radius: 3px;
border-bottom: 1px solid #eef2f8
}
.fk_service_hint {
width: 100%;
height: 40px;
line-height: 40px;
font-size: 12px;
color: #9aa8c2;
text-align: center
}
.fk_service_hint>.fk_service_icon {
background: url(../images/20190827-5d652476ab305.png) no-repeat -460px -25px;
width: 15px;
height: 15px;
margin: 13px 2px 0 18px
}
.fk_service_button {
width: 160px;
height: 38px;
line-height: 38px;
background: #4f7cfc;
border-radius: 18px;
text-align: center;
color: #fff;
margin: 5px 0 10px 20px;
cursor: pointer
}
.fk_service_button:hover {
background: #618aff
}
.fk_service_phone {
width: 100%;
height: 53px;
line-height: 53px;
font-size: 14px;
text-align: center
}
.fk_service_check_site {
width: 100%;
height: 48px;
line-height: 48px;
color: #3b6bf4;
border-top: 1px solid #eaeef5;
cursor: pointer
}
.fk_service_check_site>.fk_service_icon {
background: url(../images/20190827-5d652476ab305.png) no-repeat -461px -75px;
width: 20px;
height: 20px;
margin: 15px 2px 0 45px
}
.fk_service_feedback {
background: url(../images/20190827-5d652476ab305.png) no-repeat -363px -64px #fff
}
.fk_service_feedback:hover {
border: 0;
background: url(../images/20190827-5d652476ab305.png) no-repeat -407px -64px #4f7cfc;
cursor: pointer
}
.fk_service_feedback:hover .fk_service_feedback_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_feedback_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
.fk_service_qr {
background: url(../images/20190827-5d652476ab305.png) no-repeat -365px -113px #fff
}
.fk_service_qr:hover {
border: 0;
background: url(../images/20190827-5d652476ab305.png) no-repeat -409px -113px #4f7cfc
}
.fk_service_qr:hover .fk_service_qr_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_qr_cont {
width: 143px;
height: 202px;
border-radius: 3px;
background: #fff;
right: 62px;
position: absolute;
text-align: center;
border: 1px solid #e1e6ec;
background-color: #f6f8fb;
display: none;
opacity: 0
}
.fk_service_qr_cont>.fk_service_triangle:after {
border-left: 10px solid #f6f8fb !important
}
.fk_service_qr_cont>.fk_service_qrimg {
width: 100%;
height: 164px;
float: left
}
.fk_service_qrimg_site {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../images/20190827-5d652476ab305.png) no-repeat -41px -26px
}
.fk_service_qrimg_hd {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../images/20190827-5d652476ab305.png) no-repeat -198px -26px
}
.fk_service_qrimg_wxast {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../image/fk_service.png?v=201905151200) no-repeat -198px -328px
}
.fk_service_qrimg_flyer {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../images/20190827-5d652476ab305.png) no-repeat -41px -177px
}
.fk_service_qrimg_wxapp {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../images/20190827-5d652476ab305.png) no-repeat -198px -177px
}
.fk_service_qrimg_fkmall {
width: 119px;
height: 119px;
float: left;
margin: 12px 12px 5px 12px;
background: url(../images/20190827-5d652476ab305.png) no-repeat -41px -326px
}
.fk_service_qr_cont>.fk_service_qrtext {
width: 100%;
height: 35px;
font-size: 12px;
color: #7b89a6;
background-color: #fff;
float: left;
bottom: 0;
display: table
}
.fk_service_qr_cont>.fk_service_qrtext>span {
display: table-cell;
vertical-align: middle
}
.fk_service_upward {
display: none;
background: url(../images/20190827-5d652476ab305.png) no-repeat -363px -159px #fff
}
.fk_service_upward:hover {
border: 0;
background: url(../images/20190827-5d652476ab305.png) no-repeat -407px -159px #4f7cfc;
cursor: pointer
}
.fk_service_upward:hover .fk_service_upward_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_upward_cont {
width: 84px;
height: 40px;
line-height: 40px;
border-radius: 3px;
background: #fff;
right: 62px;
position: absolute;
text-align: center;
border: 1px solid #e1e6ec;
display: none;
opacity: 0
}
.fk_service_upward_cont span {
font-size: 14px
}
/* ----------------------------------------------------------------------- */
/* 鏂板鍥炬爣-> 寮€濮�*/
.fk_service_jk {
/* 鍓嶆櫙鍥炬爣 */
background: url(../images/20191218-c9feba3074fcf.png) no-repeat center center #fff;
background-size: 40% 40%;
}
.fk_service_jk:hover {
border: 0;
/* 榧犳爣鎮诞鍥炬爣 */
background: url(../images/20191218-9e8acd5341cdc.png) no-repeat center center #4f7cfc;
background-size: 40% 40%;
cursor: pointer
}
.fk_service_jk:hover .fk_service_jk_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_jk_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/* 鏂板鍥炬爣->zmki 缁撴潫*/
/* 鏂板鍥炬爣->zmki 寮€濮�*/
.fk_service_ws {
background: url(../images/20191218-61b4baac98ee7.png) no-repeat center center #fff;
background-size: 50% 50%;
}
.fk_service_ws:hover {
border: 0;
background: url(../images/20191218-8ded04c01bb3c.png) no-repeat center center #4f7cfc;
background-size: 50% 50%;
cursor: pointer
}
.fk_service_ws:hover .fk_service_ws_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_ws_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/* 鏂板鍥炬爣->zmki 缁撴潫*/
/* 闂數 鏂板鍥炬爣->zmki 寮€濮�*/
.fk_service_sd {
background: url(../images/20191218-94664bd399372.png) no-repeat center center #fff;
background-size: 50% 50%;
}
.fk_service_sd:hover {
border: 0;
background: url(../images/20191218-fab840acee28b.png) no-repeat center center #4f7cfc;
background-size: 50% 50%;
cursor: pointer
}
.fk_service_sd:hover .fk_service_sd_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_sd_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/*闂數 鏂板鍥炬爣->zmki 缁撴潫*/
/* 瀵艰埅 鏂板鍥炬爣->zmki 寮€濮�*/
.fk_service_dh {
background: url(../images/20191218-711bcdc875f32.png) no-repeat center center #fff;
background-size: 60% 60%;
}
.fk_service_dh:hover {
border: 0;
background: url(../images/20191218-8d9cf4c72a239.png) no-repeat center center #4f7cfc;
background-size: 60% 60%;
cursor: pointer
}
.fk_service_dh:hover .fk_service_dh_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_dh_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/*瀵艰埅 鏂板鍥炬爣->zmki 缁撴潫*/
/* 鐖卞績 鏂板鍥炬爣->zmki 寮€濮�*/
.fk_service_ax {
background: url(../images/20191218-bf1792e790a39.png) no-repeat center center #fff;
background-size: 40% 40%;
}
.fk_service_ax:hover {
border: 0;
background: url(../images/20191218-f379809ce7aef.png) no-repeat center center #4f7cfc;
background-size: 40% 40%;
cursor: pointer
}
.fk_service_ax:hover .fk_service_ax_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_ax_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/*鐖卞績 鏂板鍥炬爣->zmki 缁撴潫*/
/* 鐐硅禐 鏂板鍥炬爣->zmki 寮€濮�*/
.fk_service_dz {
background: url(../images/20191218-3d077e8df0bf0.png) no-repeat center center #fff;
background-size: 50% 50%;
}
.fk_service_dz:hover {
border: 0;
background: url(../images/20191218-986a9393f3e9e.png) no-repeat center center #4f7cfc;
background-size: 50% 50%;
cursor: pointer
}
.fk_service_dz:hover .fk_service_dz_cont {
display: block;
opacity: 1;
transition: linear .2s;
animation-name: fade-in;
animation-duration: .3s;
animation-iteration-count: 1;
animation-delay: 0s
}
.fk_service_dz_cont {
width: 200px;
height: 40px;
line-height: 40px;
background: #fff;
border-radius: 5px;
right: 62px;
text-align: center;
position: absolute;
display: none;
border: 1px solid #e1e6ec
}
/*鐐硅禐 鏂板鍥炬爣->zmki 缁撴潫*/
/* 鎵嬫満绔嚜鍔ㄩ殣钘� 寮€濮� */
@media screen and (max-width: 1221px) {
.wapnone {
display: none;
}
}
/* 鎵嬫満绔嚜鍔ㄩ殣钘� 缁撴潫 */
/*############################################*/
img {
border-width: 0px;
}
.pos-f {
position: relative;
}
.left-100 {
width: 100%;
height: 100%;
}
.blur {
-webkit-filter: blur(3px);
filter: blur(3px);
}
.tr3 {
transition: all .3s;
}
#donateBox {
/*left: calc(50% - 111px);
top: calc(50% - 15px);*/
background-color: #fff;
border: 1px solid #ddd;
border-radius: 6px;
height: 30px;
float: left;
/*z-index: 1;*/
}
#donateBox li {
width: 74px;
float: left;
text-align: center;
border-left: 1px solid #ddd;
background: no-repeat center center;
background-color: rgba(204, 217, 220, 0.1);
background-size: 45px;
transition: all .3s;
cursor: pointer;
overflow: hidden;
line-height: 600px;
height: 28px;
-webkit-filter: grayscale(1);
filter: grayscale(1);
opacity: 0.5;
}
#donateBox li:hover {
background-color: rgba(204, 217, 220, 0.3);
-webkit-filter: grayscale(0);
filter: grayscale(0);
opacity: 1;
}
#donateBox>li:first-child {
border-width: 0;
}
#donateBox a {
display: block;
}
#donateBox>#QQ {
background-image: url(../images/qq_pay.svg);
}
#donateBox #AliPay {
background-image: url(../images/alipay.svg);
}
#donateBox #WeChat {
background-image: url(../images/wechat.svg);
}
#QRBox {
top: 0;
right: 50px;
z-index: 1;
bottom: 100px;
/*background-color: rgba(255,255,255,0.3);*/
display: none;
perspective: 400px;
-webkit-touch-callout: none;
}
#MainBox {
cursor: pointer;
position: absolute;
text-align: center;
width: 200px;
height: 200px;
left: calc(50% - 100px);
top: calc(50% - 100px);
background: #fff no-repeat center center;
background-size: 190px;
border-radius: 6px;
box-shadow: 0px 2px 7px rgba(0, 0, 0, 0.3);
opacity: 0;
transition: all 1s ease-in-out;
transform-style: preserve-3d;
transform-origin: center center;
overflow: hidden;
-webkit-touch-callout: none;
}
#btc-key {
opacity: 0;
width: 2px;
height: 8px;
overflow: hidden;
left: -2px;
top: -8px;
}
[data-footnote] {
position: relative;
overflow: hidden;
}
[data-footnote]:hover {
overflow: visible;
}
[data-footnote]::before,
[data-footnote]::after {
position: absolute;
transition: all .3s;
transform: translate3d(-50%, 0, 0);
opacity: 0;
left: 37px;
z-index: 10;
}
[data-footnote]::before {
content: attr(data-footnote);
border-radius: 6px;
background-color: rgba(100, 100, 100, 0.8);
color: #fff;
height: 24px;
line-height: 24px;
padding: 0 6px;
font-size: 12px;
white-space: nowrap;
top: -24px;
left: 37px;
}
[data-footnote]::after {
content: '';
border: 5px solid #333;
border-color: rgba(100, 100, 100, 0.8) transparent transparent transparent;
top: 0;
left: 37px;
}
[data-footnote]:hover::before,
[data-footnote]:hover::after {
opacity: 1;
}
[data-footnote]:hover::before,
[data-footnote]:hover::after {
transform: translate3d(-50%, -7px, 0);
}
#MainBox.showQR {
opacity: 1;
animation-name: showQR;
animation-duration: 3s;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
animation-fill-mode: forwards;
-webkit-animation: showQR 3s ease-in-out 0s 1 normal forwards;
-webkit-touch-callout: none;
}
@keyframes showQR {
from {
transform: rotateX(90deg);
}
8% {
opacity: 1;
transform: rotateX(-60deg);
}
18% {
opacity: 1;
transform: rotateX(40deg);
}
34% {
opacity: 1;
transform: rotateX(-28deg);
}
44% {
opacity: 1;
transform: rotateX(18deg);
}
58% {
opacity: 1;
transform: rotateX(-12deg);
}
72% {
opacity: 1;
transform: rotateX(9deg);
}
88% {
opacity: 1;
transform: rotateX(-5deg);
}
96% {
opacity: 1;
transform: rotateX(2deg);
}
to {
opacity: 1;
}
}
#MainBox.hideQR {
opacity: 1;
animation-name: hideQR;
animation-duration: 0.5s;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
animation-fill-mode: forwards;
-webkit-animation: hideQR 0.5s ease-in-out 0s 1 normal forwards;
}
@keyframes hideQR {
from {}
20%,
50% {
transform: scale(1.08, 1.08);
opacity: 1;
}
to {
opacity: 0;
transform: rotateZ(40deg) scale(0.6, 0.6);
}
}

14503
src/assets/style/oneui.css Normal file

File diff suppressed because it is too large Load Diff

135
src/assets/style/reset.css Normal file
View File

@ -0,0 +1,135 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

23
src/components/Card.vue Normal file
View File

@ -0,0 +1,23 @@
<template>
<div class="col-sm-4">
<div class="block block-link-hover2 ribbon ribbon-modern ribbon-success">
<div class="ribbon-box font-w600">{{ calls }}</div>
<div class="block-content">
<div class="h4 push-5">{{ title }}</div>
<p class="text-muted">{{ description }}</p>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
title: String,
description: String,
calls: Number,
},
}
</script>
<style></style>

View File

@ -0,0 +1,15 @@
<template>
</template>
<script lang="ts" setup>
import { defineComponent } from 'vue'
defineComponent({
name: 'LoginA',
})
</script>
<style scoped>
</style>

26
src/config/index.ts Normal file
View File

@ -0,0 +1,26 @@
/**
*
*/
const env = import.meta.env.MODE == "development" ? 'dev' : 'prod'
const EnvConfig = {
dev: {
baseApi: '/',
mockApi: 'https://mock.presstime.cn/mock/668987cbcb2f4f1158f47e0e/manager-fe',
},
test: {
baseApi: '//test.demo/api',
mockApi: 'https://mock.presstime.cn/mock/668987cbcb2f4f1158f47e0e/manager-fe',
},
prod: {
baseApi: '/',
mockApi: 'https://mock.presstime.cn/mock/668987cbcb2f4f1158f47e0e/manager-fe',
}
}
export default {
env,
mock: true,
namespace: "fromsko",
...EnvConfig[env]
}

14
src/env.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_BASE_URL: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
declare module '*.vue' {
import { DefineComponent } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}

19
src/main.ts Normal file
View File

@ -0,0 +1,19 @@
// 程序入口
import storage from '@/stores/storage'
import request from '@/utils/request'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createPinia } from 'pinia'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
const app = createApp(App)
app.config.globalProperties.$request = request
app.config.globalProperties.$storage = storage
app.use(ElementPlus)
app.use(createPinia())
app.use(router)
app.mount('#app')

102
src/router/index.ts Normal file
View File

@ -0,0 +1,102 @@
// index.js - router
import storage from "@/stores/storage"
import useColorLogOutPut from "@/utils/color_log"
import About from "@/views/About.vue"
import ApiPage from '@/views/ApiPage.vue'
import Base from "@/views/Base.vue"
import Home from "@/views/Home.vue"
import Login from "@/views/Login.vue"
import Welcome from "@/views/Welcome.vue"
import { createRouter, createWebHashHistory } from "vue-router"
const log = useColorLogOutPut()
const routes = [
{
name: 'home',
path: '/',
meta: {
title: "首页"
},
component: Base,
},
{
path: '/api/docs',
name: 'Api',
component: ApiPage,
props: ((route: any) => {
return route.params
}),
meta: {
title: "内容"
},
},
{
name: 'Login',
path: '/Login',
component: Login,
meta: {
title: "登陆页^_^"
}
},
{
name: 'Welcome',
path: '/Welcome',
component: Welcome,
meta: {
title: "欢迎页"
}
},
{
name: 'demo',
path: '/demo',
meta: {
title: "首页"
},
component: Home,
children: [
{
name: 'About',
path: '/About',
component: About,
meta: {
title: "关于"
},
}
],
},
]
// router 对象
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: routes
})
//导航守卫
router.beforeEach((to, from, next) => {
// 设置标签信息
const { meta: { title } } = to
document.title = title as string || '自定义名称'
// 判断是否在 (注册|登录)
if (to.path == '/Login') return next()
if (to.path == '/register') return next()
const tokenStr = storage.getItem('token')
if (!tokenStr) return next('/Login')
next()
})
// 全局解析守
router.beforeResolve((to, from, next) => {
log.info('我是全局解析守卫')
next()
})
// // 全局后置守卫
// router.afterEach((to, from, failure) => {
// // console.log('全局后置守卫', to, from, failure)
// // next()
// })
export default router

12
src/stores/counter.ts Normal file
View File

@ -0,0 +1,12 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
export const useCounterStore = defineStore('counter', () => {
const count = ref(0)
const doubleCount = computed(() => count.value * 2)
function increment() {
count.value++
}
return { count, doubleCount, increment }
})

37
src/stores/storage.ts Normal file
View File

@ -0,0 +1,37 @@
/**
* storage
* @author fromsko
*/
import config from "@/config"
export default {
setItem(key: any, val: any) {
let storage = this.getStorage()
storage[key] = val
window.localStorage.setItem(
config.namespace,
JSON.stringify(storage)
)
},
getItem(key: any) {
return this.getStorage()[key]
},
getStorage() {
return JSON.parse(
window.localStorage.getItem(
config.namespace
) || "{}"
)
},
clearItem(key: any) {
let storage = this.getStorage()
delete storage[key]
window.localStorage.setItem(
config.namespace,
JSON.stringify(storage)
)
},
clearAll() {
window.localStorage.clear()
}
}

102
src/utils/color_log.ts Normal file
View File

@ -0,0 +1,102 @@
/*
*/
const useColorLogOutPut = () => {
const isProduction = import.meta.env.MODE === 'production'
const isEmpty = (value: any) => {
return value == null || value === undefined || value === ''
}
const prettyPrint = (title: any, text: any, color: any) => {
if (isProduction) return
console.log(
`%c ${title} %c ${text} %c`,
`background:${color};border:1px solid ${color}; padding: 1px; border-radius: 2px 0 0 2px; color: #fff;`,
`border:1px solid ${color}; padding: 1px; border-radius: 0 2px 2px 0; color: ${color};`,
'background:transparent'
)
}
const info = (textOrTitle: any, content = '') => {
const title = isEmpty(content) ? 'Info' : textOrTitle
const text = isEmpty(content) ? textOrTitle : content
prettyPrint(title, text, '#909399')
}
const error = (textOrTitle: any, content = '') => {
const title = isEmpty(content) ? 'Error' : textOrTitle
const text = isEmpty(content) ? textOrTitle : content
prettyPrint(title, text, '#F56C6C')
}
const warning = (textOrTitle: any, content = '') => {
const title = isEmpty(content) ? 'Warning' : textOrTitle
const text = isEmpty(content) ? textOrTitle : content
prettyPrint(title, text, '#E6A23C')
}
const success = (textOrTitle: any, content = '') => {
const title = isEmpty(content) ? 'Success ' : textOrTitle
const text = isEmpty(content) ? textOrTitle : content
prettyPrint(title, text, '#67C23A')
}
const table = () => {
const data = [
{ id: 1, name: 'Alice', age: 25 },
{ id: 2, name: 'Bob', age: 30 },
{ id: 3, name: 'Charlie', age: 35 }
]
console.log(
'%c id%c name%c age',
'color: white; background-color: black; padding: 2px 10px;',
'color: white; background-color: black; padding: 2px 10px;',
'color: white; background-color: black; padding: 2px 10px;'
)
data.forEach((row) => {
console.log(
`%c ${row.id} %c ${row.name} %c ${row.age} `,
'color: black; background-color: lightgray; padding: 2px 10px;',
'color: black; background-color: lightgray; padding: 2px 10px;',
'color: black; background-color: lightgray; padding: 2px 10px;'
)
})
}
const picture = (url: any, scale = 1) => {
if (isProduction) return
const img = new Image()
img.crossOrigin = 'anonymous'
img.onload = () => {
const c = document.createElement('canvas')
const ctx = c.getContext('2d')
if (ctx) {
c.width = img.width
c.height = img.height
ctx.fillStyle = 'red'
ctx.fillRect(0, 0, c.width, c.height)
ctx.drawImage(img, 0, 0)
const dataUri = c.toDataURL('image/png')
console.log(
`%c sup?`,
`font-size: 1px;
padding: ${Math.floor((img.height * scale) / 2)}px ${Math.floor((img.width * scale) / 2)}px;
background-image: url(${dataUri});
background-repeat: no-repeat;
background-size: ${img.width * scale}px ${img.height * scale}px;
color: transparent;
`
)
}
}
img.src = url
}
return {
info,
error,
warning,
success,
picture,
table
}
}
// 创建打印对象
export default useColorLogOutPut

78
src/utils/request.ts Normal file
View File

@ -0,0 +1,78 @@
import config from "@/config"
import router from "@/router"
import axios from "axios"
import { ElMessage } from "element-plus"
const TOKEN_ERROR = "Token 已过期"
const NETWORK_ERROR = "网络异常"
const service = axios.create({
baseURL: config.baseApi,
timeout: 8000,
})
// 请求封装
service.interceptors.request.use((req: any) => {
const headers = req.headers
if (!headers.Authorization) {
headers.Authorization = "bear fromsko"
}
return req
})
// 响应封装
service.interceptors.response.use((res: any) => {
const { code, data, msg } = res.data
if (code === 200) {
return data
} else if (code === 40001) {
ElMessage.error(TOKEN_ERROR)
setTimeout(() => {
router.push('/login')
}, 1500)
return Promise.reject(TOKEN_ERROR)
} else {
ElMessage.error(msg || NETWORK_ERROR)
return Promise.reject(msg || NETWORK_ERROR)
}
})
interface RequestOptions {
method?: string;
params?: any;
data?: any;
url: string;
}
function request(options: RequestOptions): any {
options.method = options.method || 'get';
if (options.method.toLowerCase() === 'get') {
options.params = options.data;
}
if (config.env === "prod") {
service.defaults.baseURL = config.baseApi;
} else {
service.defaults.baseURL = config.mock ? config.mockApi : config.baseApi;
}
return service(options);
}
['get', 'post', 'delete', 'put'].forEach((item) => {
// 使用 as any 来避免类型检查错误
(request as any)[item] = (url: string, data: any, options: any) => {
return request({
url,
data,
method: item,
...options
});
};
});
export default request

59
src/views/About.vue Normal file
View File

@ -0,0 +1,59 @@
<template>
<div class="about-layout">
<h1>关于</h1>
<br />
<div class="about-area">
<el-button-group class="ml-3">
<el-button type="info" @click="$router.push('/')">主页</el-button>
<el-button type="info" @click="$router.push('/Login')"
>登录页</el-button
>
<el-button type="success" @click="clearToken">清空登录缓存</el-button>
</el-button-group>
<br />
<p>这是一个基于 Vue3 实现的软件库</p>
<br />
<div>
包含如下功能
<ul>
<li>1. 云更新</li>
<li>2. 代码编辑器</li>
<li>3. CI/CD 自动构建</li>
<li>4. 发卡</li>
<li>5. 数据统计</li>
</ul>
</div>
</div>
</div>
</template>
<script>
import storage from '@/stores/storage'
const clearToken = () => {
storage.clearItem('token')
}
export default {
name: 'about',
methods: { clearToken },
}
</script>
<style>
.about-area {
margin: 8px;
}
.about-layout h1 {
display: flex;
justify-content: center;
align-items: center;
}
.about-layout .toLogin {
border: 10px;
color: blue;
font-size: large;
}
</style>

15
src/views/AboutView.vue Normal file
View File

@ -0,0 +1,15 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>
<style>
@media (min-width: 1024px) {
.about {
min-height: 100vh;
display: flex;
align-items: center;
}
}
</style>

20
src/views/ApiPage.vue Normal file
View File

@ -0,0 +1,20 @@
<template>
<div>
<div>
{{ $route.params }}
</div>
</div>
</template>
<script setup>
import { useRoute } from 'vue-router'
// import { defineProps, onMounted, ref } from 'vue'
// import { useRoute, useRouter } from 'vue-router'
let route = useRoute()
console.log('测试: ', route.params)
</script>
<style scoped></style>

106
src/views/Base.vue Normal file
View File

@ -0,0 +1,106 @@
<template>
<div>
<header class="site-header">
<nav class="nav_jsxs">
<img class="logo_jsxs" style="float: left" />
<router-link to="/Login">登录</router-link>
<router-link to="/About">关于</router-link>
</nav>
<div class="box-text">
<h1>Fromkso 软件库</h1>
<p>
第三方验证对接云更新软件库<br />
<span class="package-amount"
>共收录了 <strong> 0 </strong>个软件
</span>
</p>
<!-- 搜索框 -->
<div class="search-warper">
<div class="form-group">
<el-input
placeholder="搜索需要的工具"
spellcheck="false"
v-model="searchQuery"
style="width: 240px"
clearable
></el-input>
</div>
</div>
</div>
</header>
<div class="card-list"></div>
<section class="content content-boxed">
<p class="p-jsxs">拒绝流量劫持全面使用 HTTPS</p>
<Card
v-for="api in apis"
:key="api.id"
:title="api.title"
:description="api.description"
:calls="api.calls"
@click="handleCardClick(api)"
/>
</section>
<footer>
<br />
<h2>我是底部!</h2>
</footer>
</div>
</template>
<script setup>
import Card from '@/components/Card.vue'
import { computed, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const searchQuery = ref('')
const apis = reactive([
{
id: 1,
title: 'layout_one',
description: '这是第一种布局方式',
calls: 10,
href: '/doc/query/test/demo',
},
{
id: 2,
title: 'API 2',
description: '这是 API 2 的描述',
calls: 5,
href: '/doc/query/test/demo1',
},
{
id: 3,
title: 'API 3',
description: '这是 API 3 的描述',
calls: 3,
href: '/doc/query/test/demo2',
},
// API ...
])
const filteredApis = computed(() =>
this.apis.filter((api) => {
console.log(api.title.includes(this.searchQuery))
})
)
const handleCardClick = (apiInfo) => {
router.push({
name: 'Api',
params: {
apiInfo: JSON.stringify(apiInfo),
title: apiInfo.title,
},
})
}
</script>
<style scoped>
.rounded-input .el-input__inner {
border-radius: 20px;
}
</style>

69
src/views/Home.vue Normal file
View File

@ -0,0 +1,69 @@
<template>
<div class="basic-layout">
<div class="nav-side"></div>
<div class="content-right">
<div class="nav-top">
<div class="bread">面包屑</div>
<div class="user-info">用户</div>
</div>
<div class="wrapper">
<div class="main-page">
<router-view></router-view>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'home',
methods: {},
}
</script>
<style lang="scss">
.basic-layout {
position: relative;
.nav-side {
position: fixed;
width: 200px;
height: 100vh;
background-color: #001529;
color: #fff;
overflow-y: auto;
transition: width 0.5s;
}
.content-right {
margin-left: 200px;
.nav-top {
height: 50px;
line-height: 50px;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #ddd;
padding: 0 20px;
}
.wrapper {
background: #eef0f3;
padding: 20px;
height: calc(100vh - 50px);
.main-page {
height: 100%;
background: #fff;
-webkit-user-drag: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
}
}
}
</style>

9
src/views/HomeView.vue Normal file
View File

@ -0,0 +1,9 @@
<script setup lang="ts">
import TheWelcome from '../components/TheWelcome.vue'
</script>
<template>
<main>
<TheWelcome />
</main>
</template>

112
src/views/Login.vue Normal file
View File

@ -0,0 +1,112 @@
<template>
<div class="login-container">
<div class="login-box">
<img src="@/assets/images/qq-logo.png" alt="QQ Logo" class="logo" />
<el-form :model="loginForm" @submit.native.prevent="handleSubmit">
<el-form-item>
<el-input
v-model="loginForm.qqNumber"
placeholder="account"
:prefix-icon="UserFilled"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-input
v-model="loginForm.password"
type="password"
placeholder="password"
:prefix-icon="Lock"
clearable
></el-input>
</el-form-item>
<el-button type="info" @click="$router.push('/')">返回</el-button>
<el-button
type="success"
@click="handleSubmit"
:disabled="!loginForm.password"
:loading="isSending"
>登录</el-button
>
</el-form>
</div>
</div>
</template>
<script setup>
import storage from '@/stores/storage'
import { Lock, UserFilled } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { defineComponent, reactive, ref } from 'vue'
import { useRouter } from 'vue-router'
const isLogin = ref(true)
const isSending = ref(false)
const loginForm = reactive({
qqNumber: '',
password: '',
})
const router = useRouter()
const handleSubmit = () => {
isSending.value = true
if (loginForm.qqNumber && loginForm.password) {
isLogin.value = true
storage.setItem('token', 'sk-Passed')
ElMessage.success('登录成功')
} else {
ElMessage.error('请填写完整的登录信息')
}
isSending.value = false
setTimeout(router.push('/'), 1500)
}
defineComponent({
name: 'Login',
})
</script>
<style scoped>
.login-container {
padding: 0;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-size: cover;
background-position: center;
background-image: url('@/assets/images/background.jpg');
}
.login-box {
width: 90%;
max-width: 250px;
padding: 20px;
border-radius: 15px;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.2);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
margin: 0 auto;
}
@media (max-width: 600px) {
.login-box {
width: 90%;
max-width: none;
}
}
.logo {
width: 60px;
height: 60px;
margin-bottom: 20px;
-webkit-user-drag: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>

13
src/views/Welcome.vue Normal file
View File

@ -0,0 +1,13 @@
<template>
<h1>欢迎页面</h1>
<router-link to="/login">去登陆</router-link>
</template>
<script>
export default {
name: 'welcome',
methods: {},
}
</script>
<style></style>

14
tsconfig.app.json Normal file
View File

@ -0,0 +1,14 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"moduleResolution": "node"
}
}

17
tsconfig.json Normal file
View File

@ -0,0 +1,17 @@
{
"files": [],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.vitest.json"
}
],
"compilerOptions": {
"types": ["vite/client", "./env"]
}
}

18
tsconfig.node.json Normal file
View File

@ -0,0 +1,18 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": [
"vite.config.*",
"vitest.config.*",
"cypress.config.*",
"nightwatch.conf.*",
"playwright.config.*"
],
"compilerOptions": {
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]
}
}

10
tsconfig.vitest.json Normal file
View File

@ -0,0 +1,10 @@
{
"extends": "./tsconfig.app.json",
"exclude": [],
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
"lib": [],
"types": ["node", "jsdom"]
}
}

16
vite.config.ts Normal file
View File

@ -0,0 +1,16 @@
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))
}
}
})

14
vitest.config.ts Normal file
View File

@ -0,0 +1,14 @@
import { fileURLToPath } from 'node:url'
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
import viteConfig from './vite.config'
export default mergeConfig(
viteConfig,
defineConfig({
test: {
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/**'],
root: fileURLToPath(new URL('./', import.meta.url))
}
})
)