diff --git a/.env.development b/.env.development index a3ae4d4..1641112 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,7 @@ -# 开发环境 -VITE_USER_NODE_ENV = development - -# 开发环境地址前缀 (一般 '/' 或 './' 都可以) -VITE_PUBLIC_PATH = '/' \ No newline at end of file +# 开发环境 +VITE_USER_NODE_ENV = development + +# 开发环境地址前缀 (一般 '/' 或 './' 都可以) +VITE_PUBLIC_PATH = '/' + +VITE_GLOB_APP_TITLE = SnowAdmin \ No newline at end of file diff --git a/.env.production b/.env.production index 0387852..98bbd57 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,7 @@ -# 生产环境 -VITE_USER_NODE_ENV = production - -# 打包路径 (就是网站前缀, 例如部署到 http://dcodes.gitee.io/dc-admin/ 域名下, 就需要填写 /dc-admin/), 一般填一个斜杠 / -VITE_PUBLIC_PATH = '/dc-admin/' \ No newline at end of file +# 生产环境 +VITE_USER_NODE_ENV = production + +# 打包路径 (就是网站前缀, 例如部署到 http://dcodes.gitee.io/dc-admin/ 域名下, 就需要填写 /dc-admin/), 一般填一个斜杠 / +VITE_PUBLIC_PATH = '/dc-admin/' + +VITE_GLOB_APP_TITLE = SnowAdmin \ No newline at end of file diff --git a/.env.test b/.env.test index 7a393e7..1641112 100644 --- a/.env.test +++ b/.env.test @@ -2,4 +2,6 @@ VITE_USER_NODE_ENV = development # 开发环境地址前缀 (一般 '/' 或 './' 都可以) -VITE_PUBLIC_PATH = '/' \ No newline at end of file +VITE_PUBLIC_PATH = '/' + +VITE_GLOB_APP_TITLE = SnowAdmin \ No newline at end of file diff --git a/package.json b/package.json index 7c48708..9246658 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,9 @@ "scripts": { "dev": "vite", "build": "vue-tsc && vite build", + "build:dev": "vue-tsc && vite build --mode development", + "build:prod": "vue-tsc && vite build --mode production", + "build:test": "vue-tsc && vite build --mode test", "preview": "vite preview", "lint:eslint": "eslint --fix --ext .js,.ts,.vue ./src", "lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\"", diff --git a/src/directives/index.ts b/src/directives/index.ts index f41138c..4aca441 100644 --- a/src/directives/index.ts +++ b/src/directives/index.ts @@ -1,6 +1,7 @@ import { App } from "vue"; import antiShake from "@/directives/modules/anti-shake"; import throttle from "@/directives/modules/throttle"; +import custom from "@/directives/modules/custom"; // 定义安装函数 // install 函数是一个对象中的方法,其作用是将一系列指令对象安装到 Vue 应用实例中,它自带两个参数:app 和 options @@ -11,6 +12,7 @@ const directives = { // 将一系列自定义指令对象安装到 Vue 应用实例中 app.directive("antiShake", antiShake); app.directive("throttle", throttle); + app.directive("custom", custom); } }; diff --git a/src/directives/modules/custom.ts b/src/directives/modules/custom.ts new file mode 100644 index 0000000..3711cd7 --- /dev/null +++ b/src/directives/modules/custom.ts @@ -0,0 +1,9 @@ +import { Directive } from "vue"; + +const custom: Directive = { + mounted(el, binding) { + el.style.color = binding.value; + } +}; + +export default custom; diff --git a/src/lang/modules/enUS.ts b/src/lang/modules/enUS.ts index eb81fa5..7685968 100644 --- a/src/lang/modules/enUS.ts +++ b/src/lang/modules/enUS.ts @@ -31,6 +31,7 @@ export default { ["custom-instruction"]: "custom instruction", ["anti-shake"]: "anti shake", ["throttle"]: "throttle", + ["test-instruction"]: "test instruction", ["personal-center"]: "personal center", ["userinfo"]: "userinfo", ["user-settings"]: "user settings", diff --git a/src/lang/modules/zhCN.ts b/src/lang/modules/zhCN.ts index bbe1531..899867e 100644 --- a/src/lang/modules/zhCN.ts +++ b/src/lang/modules/zhCN.ts @@ -31,6 +31,7 @@ export default { ["custom-instruction"]: "自定义指令", ["anti-shake"]: "防抖", ["throttle"]: "节流", + ["test-instruction"]: "测试指令", ["personal-center"]: "个人中心", ["userinfo"]: "用户信息", ["user-settings"]: "用户设置", diff --git a/src/layout/components/Header/components/system-settings/index.vue b/src/layout/components/Header/components/system-settings/index.vue index 1509d79..c82542f 100644 --- a/src/layout/components/Header/components/system-settings/index.vue +++ b/src/layout/components/Header/components/system-settings/index.vue @@ -29,7 +29,7 @@