diff --git a/.cz-config.js b/.cz-config.js index ab285e5..729abbc 100644 --- a/.cz-config.js +++ b/.cz-config.js @@ -4,7 +4,7 @@ module.exports = { // { value: 'feat', name: 'feat: 新增功能' }, // { value: 'fix', name: 'fix: 修复 bug' }, // { value: 'docs', name: 'docs: 文档变更' }, - // { value: 'style', name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)' }, + // { value: 'styles', name: 'styles: 代码格式(不影响功能,例如空格、分号等格式修正)' }, // { value: 'refactor', name: 'refactor: 代码重构(不包括 bug 修复、功能新增)' }, // { value: 'perf', name: 'perf: 性能优化' }, // { value: 'test', name: 'test: 添加、修改测试用例' }, @@ -58,7 +58,7 @@ module.exports = { scopeOverrides: { fix: [ { name: 'merge' }, - { name: 'style' }, + { name: 'styles' }, { name: 'e2eTest' }, { name: 'unitTest' } ] diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8d55e4b..c282ccb 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -45,7 +45,7 @@ module.exports = { // 'object-curly-spacing': ['error', 'always'], // 强制在大括号中使用一致的空格 // 'max-len': ['error', 120], // 强制一行的最大长度 // 'no-new': 'off', // 禁止使用 new 以避免产生副作用 - // 'linebreak-style': 'off', // 强制使用一致的换行风格 + // 'linebreak-styles': 'off', // 强制使用一致的换行风格 // 'import/extensions': 'off', // 确保在导入路径中统一使用文件扩展名 // 'eol-last': 'off', // 要求或禁止文件末尾存在空行 // 'no-shadow': 'off', // 禁止变量声明与外层作用域的变量同名 diff --git a/src/App.vue b/src/App.vue index 02c04d5..37d4bf2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,7 @@ - + diff --git a/src/assets/svg/schisandra.svg b/src/assets/icons/schisandra.svg similarity index 98% rename from src/assets/svg/schisandra.svg rename to src/assets/icons/schisandra.svg index 78052e1..089d7a9 100644 --- a/src/assets/svg/schisandra.svg +++ b/src/assets/icons/schisandra.svg @@ -1,77 +1,77 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/svg/vue.svg b/src/assets/icons/vue.svg similarity index 98% rename from src/assets/svg/vue.svg rename to src/assets/icons/vue.svg index 74c8b17..54782fa 100644 --- a/src/assets/svg/vue.svg +++ b/src/assets/icons/vue.svg @@ -1,6 +1,6 @@ - + diff --git a/src/assets/image/wallhaven.jpg b/src/assets/images/wallhaven.jpg similarity index 100% rename from src/assets/image/wallhaven.jpg rename to src/assets/images/wallhaven.jpg diff --git a/src/style/scroll-bar.less b/src/assets/styles/scroll-bar.less similarity index 100% rename from src/style/scroll-bar.less rename to src/assets/styles/scroll-bar.less diff --git a/src/style/style.less b/src/assets/styles/style.less similarity index 100% rename from src/style/style.less rename to src/assets/styles/style.less diff --git a/src/style/variables.less b/src/assets/styles/variables.less similarity index 95% rename from src/style/variables.less rename to src/assets/styles/variables.less index e15cd16..17b64ab 100644 --- a/src/style/variables.less +++ b/src/assets/styles/variables.less @@ -1,2 +1,2 @@ -//定义全局变量 -@bg-color:#002aff; +//定义全局变量 +@bg-color:#002aff; diff --git a/src/components/svgIcon/SvgIcon.vue b/src/components/svgIcon/SvgIcon.vue index dbb742c..751f31d 100644 --- a/src/components/svgIcon/SvgIcon.vue +++ b/src/components/svgIcon/SvgIcon.vue @@ -19,7 +19,7 @@ const props = defineProps({ const iconName = computed(() => `#icon-${props.iconClass}`) const svgClass = computed(() => { if (props.className) { - return 'svg-icon ' + props.className + return 'icons-icon ' + props.className } else { return 'svg-icon' } diff --git a/src/components/svgIcon/svgIcon.less b/src/components/svgIcon/svgIcon.less index cacacc9..f533d49 100644 --- a/src/components/svgIcon/svgIcon.less +++ b/src/components/svgIcon/svgIcon.less @@ -1,5 +1,5 @@ .svg-icon { - // svg 图标默认宽高,根据个人使用情况自行调整 + // icons 图标默认宽高,根据个人使用情况自行调整 width: 100px; height:100px; fill: currentColor; diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue new file mode 100644 index 0000000..d7a83d7 --- /dev/null +++ b/src/layout/Layout.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/layout/package-info.md b/src/layout/package-info.md deleted file mode 100644 index f8317bb..0000000 --- a/src/layout/package-info.md +++ /dev/null @@ -1 +0,0 @@ -# 布局 diff --git a/src/main.ts b/src/main.ts index 82ca349..fd7a91d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,5 @@ import { createApp } from 'vue' -import './style/style.less' +import '@/assets/styles/style.less' import App from './App.vue' import router from '@/router/index' import { createPinia } from 'pinia' @@ -7,10 +7,10 @@ import Antd from 'ant-design-vue' import 'ant-design-vue/dist/reset.css' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' import '@/polyfill/polyfill' -import '@/style/scroll-bar.less' +import '@/assets/styles/scroll-bar.less' // 国际化 import i18n from '../locales' -// svg 相关 +// icons 相关 import 'virtual:svg-icons-register' import SvgIcon from './components/svgIcon/SvgIcon.vue' import 'vue-global-api' diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index fd59998..bcc20ef 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' import { ref } from 'vue' -import { IUser } from '@/interface/user/user' +import { IUser } from '@/types/user/user' export const useAuthStore = defineStore( 'user', diff --git a/src/interface/user/user.d.ts b/src/types/user/user.d.ts similarity index 93% rename from src/interface/user/user.d.ts rename to src/types/user/user.d.ts index 28c3a27..5dde46d 100644 --- a/src/interface/user/user.d.ts +++ b/src/types/user/user.d.ts @@ -1,7 +1,7 @@ -// 测试 -export interface IUser { - token: string - userId: number - LOADING: false - userInfo: unknown -} +// 测试 +export interface IUser { + token: string + userId: number + LOADING: false + userInfo: unknown +} diff --git a/src/views/login/LoginPage.vue b/src/views/login/LoginPage.vue index ac9d84d..7d683af 100644 --- a/src/views/login/LoginPage.vue +++ b/src/views/login/LoginPage.vue @@ -13,7 +13,7 @@ export default defineComponent({

Login

测试页面,看到这个,那么项目就成功跑起来了

- + diff --git a/vite.config.mts b/vite.config.mts index add7abd..4cf6399 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -10,7 +10,7 @@ import Components from 'unplugin-vue-components/vite' //ant-design-vue import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers' -// svg plugin +// icons plugin import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import autoprefixer from 'autoprefixer' @@ -37,7 +37,7 @@ export default defineConfig(({ mode, command }) => { less: { javascriptEnabled: true, charset: false, //禁用字符集声明(charset 选项用于控制是否在生成的 CSS 文件的头部添加 @charset "UTF-8";) - additionalData: '@import "./src/style/variables.less";' + additionalData: '@import "./src/assets/styles/variables.less";' } }, postcss: { @@ -112,10 +112,10 @@ export default defineConfig(({ mode, command }) => { ext: '.gz', deleteOriginFile: true // 源文件压缩后是否删除 }), - // 修改 svg 相关配置 + // 修改 icons 相关配置 createSvgIconsPlugin({ // 指定需要缓存的图标文件夹 - iconDirs: [path.resolve(__dirname, './src/assets/svg')] + iconDirs: [path.resolve(__dirname, './src/assets/icons')] }), legacy({ renderLegacyChunks: true,