Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-20 10:59:21 +08:00

refactor: 迁移 assets 到 common 目录

This commit is contained in:
pany 2024-11-27 10:09:14 +08:00
parent f197777060
commit fd6b76f990
61 changed files with 38 additions and 38 deletions

View File

@ -1,5 +1,5 @@
<div align="center">
<img alt="V3 Admin Vite Logo" width="120" height="120" src="./src/assets/images/layouts/logo.png">
<img alt="V3 Admin Vite Logo" width="120" height="120" src="./src/common/assets/images/layouts/logo.png">
<h1>V3 Admin Vite</h1>
<span>English | <a href="./README.zh-CN.md">中文</a></span>
</div>
@ -128,9 +128,9 @@ pnpm test
## Project preview
![preview1.png](./src/assets/images/docs/preview1.png)
![preview2.png](./src/assets/images/docs/preview2.png)
![preview3.png](./src/assets/images/docs/preview3.png)
![preview1.png](./src/common/assets/images/docs/preview1.png)
![preview2.png](./src/common/assets/images/docs/preview2.png)
![preview3.png](./src/common/assets/images/docs/preview3.png)
## 💕 Contributors

View File

@ -1,5 +1,5 @@
<div align="center">
<img alt="V3 Admin Vite Logo" width="120" height="120" src="./src/assets/images/layouts/logo.png">
<img alt="V3 Admin Vite Logo" width="120" height="120" src="./src/common/assets/images/layouts/logo.png">
<h1>V3 Admin Vite</h1>
<span><a href="./README.md">English</a> | 中文</span>
</div>
@ -122,9 +122,9 @@ pnpm test
## 项目预览图
![preview1.png](./src/assets/images/docs/preview1.png)
![preview2.png](./src/assets/images/docs/preview2.png)
![preview3.png](./src/assets/images/docs/preview3.png)
![preview1.png](./src/common/assets/images/docs/preview1.png)
![preview2.png](./src/common/assets/images/docs/preview2.png)
![preview3.png](./src/common/assets/images/docs/preview3.png)
## 💕 贡献者

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 747 B

After

Width:  |  Height:  |  Size: 747 B

View File

Before

Width:  |  Height:  |  Size: 746 B

After

Width:  |  Height:  |  Size: 746 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

View File

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 694 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 539 B

View File

Before

Width:  |  Height:  |  Size: 925 B

After

Width:  |  Height:  |  Size: 925 B

View File

Before

Width:  |  Height:  |  Size: 613 B

After

Width:  |  Height:  |  Size: 613 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 775 B

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 373 KiB

View File

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -88,7 +88,7 @@ defineExpose({ getScrollTop })
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
.result-item {
display: flex;

View File

@ -29,7 +29,7 @@ const settingsStore = useSettingsStore()
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
.app-main {
width: 100%;

View File

@ -1,8 +1,8 @@
<script lang="ts" setup>
import logo from "@/assets/images/layouts/logo.png?url"
import logoText1 from "@/assets/images/layouts/logo-text-1.png?url"
import logoText2 from "@/assets/images/layouts/logo-text-2.png?url"
import { useLayoutMode } from "@/composables/useLayoutMode"
import logo from "@@/assets/images/layouts/logo.png?url"
import logoText1 from "@@/assets/images/layouts/logo-text-1.png?url"
import logoText2 from "@@/assets/images/layouts/logo-text-2.png?url"
interface Props {
collapse?: boolean

View File

@ -72,7 +72,7 @@ function resetLayoutsConfig() {
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
.setting-container {
padding: 20px;

View File

@ -79,7 +79,7 @@ function resolvePath(routePath: string) {
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
.svg-icon {
min-width: 1em;

View File

@ -50,7 +50,7 @@ function handleClickOutside() {
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
$transition-time: 0.35s;
.app-wrapper {

View File

@ -38,7 +38,7 @@ const layoutClasses = computed(() => {
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
$transition-time: 0.35s;
.app-wrapper {

View File

@ -26,7 +26,7 @@ const { showTagsView, showLogo } = storeToRefs(settingsStore)
</template>
<style lang="scss" scoped>
@import "@/assets/styles/mixins.scss";
@import "@@/assets/styles/mixins.scss";
$transition-time: 0.35s;
.app-wrapper {

View File

@ -13,7 +13,7 @@ import "element-plus/dist/index.css"
import "element-plus/theme-chalk/dark/css-vars.css"
import "vxe-table/lib/style.css"
import "vxe-table-plugin-element/dist/style.css"
import "@/assets/styles/index.scss"
import "@@/assets/styles/index.scss"
const app = createApp(App)

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import Svg403 from "@/assets/images/error-page/403.svg?component" // vite-svg-loader
import Svg403 from "@@/assets/images/error-page/403.svg?component" // vite-svg-loader
import ErrorPageLayout from "./components/ErrorPageLayout.vue"
</script>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import Svg404 from "@/assets/images/error-page/404.svg?component" // vite-svg-loader
import Svg404 from "@@/assets/images/error-page/404.svg?component" // vite-svg-loader
import ErrorPageLayout from "./components/ErrorPageLayout.vue"
</script>

View File

@ -28,7 +28,7 @@ const props = defineProps<Props>()
width: 120px;
height: 95px;
transform: translateY(12%);
@include backgroundImage("@/assets/images/login/face.png");
@include backgroundImage("@@/assets/images/login/face.png");
.hand-down-left,
.hand-down-right {
z-index: 2;
@ -40,12 +40,12 @@ const props = defineProps<Props>()
.hand-down-left {
bottom: 3px;
left: -35px;
@include backgroundImage("@/assets/images/login/hand-down-left.png");
@include backgroundImage("@@/assets/images/login/hand-down-left.png");
}
.hand-down-right {
bottom: 3px;
right: -40px;
@include backgroundImage("@/assets/images/login/hand-down-right.png");
@include backgroundImage("@@/assets/images/login/hand-down-right.png");
}
.hand-up-left,
.hand-up-right {
@ -59,12 +59,12 @@ const props = defineProps<Props>()
.hand-up-left {
bottom: 11px;
left: -5px;
@include backgroundImage("@/assets/images/login/hand-up-left.png");
@include backgroundImage("@@/assets/images/login/hand-up-left.png");
}
.hand-up-right {
bottom: 11px;
right: 5px;
@include backgroundImage("@/assets/images/login/hand-up-right.png");
@include backgroundImage("@@/assets/images/login/hand-up-right.png");
}
.close-eyes {
z-index: 1;
@ -72,7 +72,7 @@ const props = defineProps<Props>()
height: 100%;
opacity: 0;
transition: opacity 0.1s linear 0.1s;
@include backgroundImage("@/assets/images/login/close-eyes.png");
@include backgroundImage("@@/assets/images/login/close-eyes.png");
}
}

View File

@ -86,7 +86,7 @@ createCode()
<Owl :close-eyes="isFocus" />
<div class="login-card">
<div class="title">
<img src="@/assets/images/layouts/logo-text-2.png">
<img src="@@/assets/images/layouts/logo-text-2.png">
</div>
<div class="content">
<el-form ref="loginFormRef" :model="loginFormData" :rules="loginFormRules" @keyup.enter="handleLogin">

View File

@ -17,7 +17,10 @@
"module": "esnext",
"moduleResolution": "bundler",
// baseUrl
"paths": { "@/*": ["src/*"] },
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/common/*"]
},
"resolveJsonModule": true,
"types": ["vite/client", "element-plus/global"],
// JS
@ -32,12 +35,7 @@
"skipLibCheck": true
},
//
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.vue",
"**/*.d.ts"
],
"include": ["**/*.ts", "**/*.tsx", "**/*.vue", "**/*.d.ts"],
//
"exclude": ["node_modules", "dist"]
}

View File

@ -9,7 +9,7 @@ declare module "vue-router" {
*/
title?: string
/**
* @description svg @/assets/icons
* @description svg src/common/assets/icons
*/
svgIcon?: string
/**

View File

@ -18,7 +18,9 @@ export default defineConfig(({ mode }) => {
resolve: {
alias: {
// @ 符号指向 src 目录
"@": resolve(__dirname, "src")
"@": resolve(__dirname, "src"),
// @@ 符号指向 src/common 目录
"@@": resolve(__dirname, "src/common")
}
},
// 开发环境服务器配置
@ -91,7 +93,7 @@ export default defineConfig(({ mode }) => {
svgLoader({ defaultImport: "url" }),
// 生成 SVG 雪碧图
createSvgIconsPlugin({
iconDirs: [resolve(root, "src/assets/icons")],
iconDirs: [resolve(root, "src/common/assets/icons")],
symbolId: "icon-[dir]-[name]",
// 自定义 SVGO 配置
svgoOptions: {