Browse Source

perf: 同步完整版分支代码

i18n
xiaoxian521 3 years ago
parent
commit
0bdaf55ff1
  1. 6
      babel.config.js
  2. 89
      index.html
  3. 4
      package.json
  4. 47
      pnpm-lock.yaml
  5. 7
      src/layout/components/navbar.vue
  6. 2
      src/layout/components/setting/index.vue
  7. 7
      src/layout/components/sidebar/hamBurger.vue
  8. 3
      vite.config.ts

6
babel.config.js

@ -1,6 +0,0 @@
const productPlugins = [];
process.env.NODE_ENV === "production" &&
productPlugins.push("transform-remove-console");
module.exports = {
plugins: [...productPlugins]
};

89
index.html

@ -6,6 +6,7 @@
<link rel="stylesheet" href="/iconfont.css" /> <link rel="stylesheet" href="/iconfont.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>pure-admin-thin</title> <title>pure-admin-thin</title>
<script src="/sortable.min.js"></script>
<script> <script>
window.process = {}; window.process = {};
</script> </script>
@ -14,35 +15,89 @@
<body> <body>
<div id="app"> <div id="app">
<style> <style>
p {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 26px;
* {
margin: 0;
padding: 0;
}
html,
body {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
font-family: "Reggae One", cursive;
}
.loader,
.loader:before,
.loader:after {
border-radius: 50%;
width: 2.5em;
height: 2.5em;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation: loadAnimation 1.8s infinite ease-in-out;
animation: loadAnimation 1.8s infinite ease-in-out;
} }
p::after {
.loader {
color: #406eeb;
font-size: 10px;
margin: 80px auto;
position: relative;
text-indent: -9999em;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
.loader:before,
.loader:after {
content: ""; content: "";
position: absolute; position: absolute;
top: 0%;
bottom: 0;
animation: dot 1s infinite steps(1, start);
top: 0;
} }
@keyframes dot {
33.33% {
content: ".";
.loader:before {
left: -3.5em;
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
} }
66.67% {
content: "..";
.loader:after {
left: 3.5em;
} }
@-webkit-keyframes loadAnimation {
0%,
80%,
100% { 100% {
content: "...";
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
}
}
@keyframes loadAnimation {
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;
} }
} }
</style> </style>
<p>Loading</p>
<div class="loader">Loading...</div>
</div> </div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
</body> </body>

4
package.json

@ -49,7 +49,7 @@
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"path": "^0.12.7", "path": "^0.12.7",
"pinia": "^2.0.0-rc.14",
"pinia": "^2.0.9",
"qs": "^6.10.2", "qs": "^6.10.2",
"remixicon": "^2.5.0", "remixicon": "^2.5.0",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
@ -78,7 +78,6 @@
"@vue/eslint-config-typescript": "7.0.0", "@vue/eslint-config-typescript": "7.0.0",
"@zougt/vite-plugin-theme-preprocessor": "^1.4.0", "@zougt/vite-plugin-theme-preprocessor": "^1.4.0",
"autoprefixer": "10.2.4", "autoprefixer": "10.2.4",
"babel-plugin-transform-remove-console": "6.9.4",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"eslint": "7.30.0", "eslint": "7.30.0",
"eslint-plugin-prettier": "3.4.0", "eslint-plugin-prettier": "3.4.0",
@ -99,6 +98,7 @@
"typescript": "4.4.2", "typescript": "4.4.2",
"unplugin-element-plus": "^0.1.3", "unplugin-element-plus": "^0.1.3",
"vite": "2.6.14", "vite": "2.6.14",
"vite-plugin-full-reload": "^1.0.0",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "^1.2.1", "vite-plugin-style-import": "^1.2.1",
"vite-svg-loader": "^2.2.0", "vite-svg-loader": "^2.2.0",

47
pnpm-lock.yaml

@ -28,7 +28,6 @@ specifiers:
animate.css: ^4.1.1 animate.css: ^4.1.1
autoprefixer: 10.2.4 autoprefixer: 10.2.4
axios: ^0.21.1 axios: ^0.21.1
babel-plugin-transform-remove-console: 6.9.4
cross-env: 7.0.3 cross-env: 7.0.3
css-color-function: ^1.3.3 css-color-function: ^1.3.3
dayjs: ^1.10.7 dayjs: ^1.10.7
@ -46,7 +45,7 @@ specifiers:
mockjs: ^1.1.0 mockjs: ^1.1.0
nprogress: ^0.2.0 nprogress: ^0.2.0
path: ^0.12.7 path: ^0.12.7
pinia: ^2.0.0-rc.14
pinia: ^2.0.9
postcss: 8.2.6 postcss: 8.2.6
postcss-import: 14.0.0 postcss-import: 14.0.0
prettier: 2.3.2 prettier: 2.3.2
@ -66,6 +65,7 @@ specifiers:
typescript: 4.4.2 typescript: 4.4.2
unplugin-element-plus: ^0.1.3 unplugin-element-plus: ^0.1.3
vite: 2.6.14 vite: 2.6.14
vite-plugin-full-reload: ^1.0.0
vite-plugin-mock: ^2.9.6 vite-plugin-mock: ^2.9.6
vite-plugin-style-import: ^1.2.1 vite-plugin-style-import: ^1.2.1
vite-svg-loader: ^2.2.0 vite-svg-loader: ^2.2.0
@ -97,7 +97,7 @@ dependencies:
mockjs: 1.1.0 mockjs: 1.1.0
nprogress: 0.2.0 nprogress: 0.2.0
path: 0.12.7 path: 0.12.7
pinia: 2.0.2[email protected][email protected]
pinia: 2.0.9[email protected][email protected]
qs: 6.10.2 qs: 6.10.2
remixicon: 2.5.0 remixicon: 2.5.0
resize-observer-polyfill: 1.5.1 resize-observer-polyfill: 1.5.1
@ -126,7 +126,6 @@ devDependencies:
"@vue/eslint-config-typescript": 7.0.0_e03d82996bd4a66fb128f33523d782ea "@vue/eslint-config-typescript": 7.0.0_e03d82996bd4a66fb128f33523d782ea
"@zougt/vite-plugin-theme-preprocessor": 1.4[email protected] "@zougt/vite-plugin-theme-preprocessor": 1.4[email protected]
autoprefixer: 10.2[email protected] autoprefixer: 10.2[email protected]
babel-plugin-transform-remove-console: 6.9.4
cross-env: 7.0.3 cross-env: 7.0.3
eslint: 7.30.0 eslint: 7.30.0
eslint-plugin-prettier: 3.4[email protected][email protected] eslint-plugin-prettier: 3.4[email protected][email protected]
@ -147,6 +146,7 @@ devDependencies:
typescript: 4.4.2 typescript: 4.4.2
unplugin-element-plus: 0.1[email protected][email protected] unplugin-element-plus: 0.1[email protected][email protected]
vite: 2.6[email protected] vite: 2.6[email protected]
vite-plugin-full-reload: 1.0.0
vite-plugin-mock: 2.9[email protected][email protected] vite-plugin-mock: 2.9[email protected][email protected]
vite-plugin-style-import: 1.3[email protected] vite-plugin-style-import: 1.3[email protected]
vite-svg-loader: 2.2.0 vite-svg-loader: 2.2.0
@ -1397,6 +1397,13 @@ packages:
} }
dev: false dev: false
/@vue/devtools-api/6.0.0-beta.21.1:
resolution:
{
integrity: sha512-FqC4s3pm35qGVeXRGOjTsRzlkJjrBLriDS9YXbflHLsfA9FrcKzIyWnLXoNm+/7930E8rRakXuAc2QkC50swAw==
}
dev: false
/@vue/eslint-config-prettier/6.0.0_82e4252401b0cc5be86f7c2133946f49: /@vue/eslint-config-prettier/6.0.0_82e4252401b0cc5be86f7c2133946f49:
resolution: resolution:
{ {
@ -1870,10 +1877,6 @@ packages:
- debug - debug
dev: false dev: false
/babel-plugin-transform-remove-console/6.9.4:
resolution: { integrity: sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= }
dev: true
/bail/1.0.5: /bail/1.0.5:
resolution: resolution:
{ {
@ -5168,19 +5171,27 @@ packages:
engines: { node: ">=8.6" } engines: { node: ">=8.6" }
dev: true dev: true
/picomatch/2.3.1:
resolution:
{
integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
}
engines: { node: ">=8.6" }
dev: true
/pify/2.3.0: /pify/2.3.0:
resolution: { integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= } resolution: { integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw= }
engines: { node: ">=0.10.0" } engines: { node: ">=0.10.0" }
dev: true dev: true
/pinia/[email protected][email protected]:
/pinia/2.0.9[email protected][email protected]:
resolution: resolution:
{ {
integrity: sha512-ljN+9p9XHE8YrMBgxLbpo5rdVPj7Fri4Bl9qswz5dJPeoK6ra66YOLrGpBoCsHjAqu9jOBC3oJeErocicf51oA==
integrity: sha512-iuYdxLJKQ07YPyOHYH05wNG9eKWqkP/4y4GE8+RqEYtz5fwHgPA5kr6zQbg/DoEJGnR2XCm1w1vdt6ppzL9ATg==
} }
peerDependencies: peerDependencies:
"@vue/composition-api": ^1.3.0
typescript: ^4.4.4
"@vue/composition-api": ^1.4.0
typescript: ">=4.4.4"
vue: ^2.6.14 || ^3.2.0 vue: ^2.6.14 || ^3.2.0
peerDependenciesMeta: peerDependenciesMeta:
"@vue/composition-api": "@vue/composition-api":
@ -5188,7 +5199,7 @@ packages:
typescript: typescript:
optional: true optional: true
dependencies: dependencies:
"@vue/devtools-api": 6.0.0-beta.20
"@vue/devtools-api": 6.0.0-beta.21.1
typescript: 4.4.2 typescript: 4.4.2
vue: 3.2.24 vue: 3.2.24
vue-demi: 0.12[email protected] vue-demi: 0.12[email protected]
@ -7062,6 +7073,16 @@ packages:
vfile-message: 2.0.4 vfile-message: 2.0.4
dev: true dev: true
/vite-plugin-full-reload/1.0.0:
resolution:
{
integrity: sha512-GUhQ4wSm+H6yAlz7d2JwLu+BEcsFqZu1SUH0CNG+uyP4ALXGofUjHi+eGdLX19bYhMuOUWW3EwMt68jFkBsMew==
}
dependencies:
picocolors: 1.0.0
picomatch: 2.3.1
dev: true
/vite-plugin-mock/[email protected][email protected]: /vite-plugin-mock/[email protected][email protected]:
resolution: resolution:
{ {

7
src/layout/components/navbar.vue

@ -14,6 +14,7 @@ import { unref, watch, getCurrentInstance } from "vue";
import { deviceDetection } from "/@/utils/deviceDetection"; import { deviceDetection } from "/@/utils/deviceDetection";
import screenfull from "../components/screenfull/index.vue"; import screenfull from "../components/screenfull/index.vue";
import globalization from "/@/assets/svg/globalization.svg"; import globalization from "/@/assets/svg/globalization.svg";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
const instance = const instance =
getCurrentInstance().appContext.config.globalProperties.$storage; getCurrentInstance().appContext.config.globalProperties.$storage;
@ -26,7 +27,7 @@ const { locale } = useI18n();
const getDropdownItemStyle = computed(() => { const getDropdownItemStyle = computed(() => {
return t => { return t => {
return { return {
background: locale.value === t ? "#1b2a47" : "",
background: locale.value === t ? useEpThemeStoreHook().epThemeColor : "",
color: locale.value === t ? "#f4f4f5" : "#000" color: locale.value === t ? "#f4f4f5" : "#000"
}; };
}; };
@ -149,10 +150,6 @@ function translationEn() {
cursor: pointer; cursor: pointer;
transition: background 0.3s; transition: background 0.3s;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, 0.025);
}
} }
.vertical-header-right { .vertical-header-right {

2
src/layout/components/setting/index.vue

@ -444,7 +444,7 @@ nextTick(() => {
<style scoped module> <style scoped module>
.isSelect { .isSelect {
border: 2px solid #0960bd;
border: 2px solid var(--el-color-primary);
} }
</style> </style>

7
src/layout/components/sidebar/hamBurger.vue

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
export interface Props { export interface Props {
isActive: boolean; isActive: boolean;
} }
@ -7,6 +9,8 @@ const props = withDefaults(defineProps<Props>(), {
isActive: false isActive: false
}); });
const fillColor = ref<string>("");
const emit = defineEmits<{ const emit = defineEmits<{
(e: "toggleClick"): void; (e: "toggleClick"): void;
}>(); }>();
@ -21,8 +25,11 @@ const toggleClick = () => {
:class="classes.container" :class="classes.container"
:title="props.isActive ? '点击折叠' : '点击展开'" :title="props.isActive ? '点击折叠' : '点击展开'"
@click="toggleClick" @click="toggleClick"
@mouseenter="fillColor = useEpThemeStoreHook().epThemeColor"
@mouseleave="fillColor = ''"
> >
<svg <svg
:fill="fillColor"
:class="['hamburger', props.isActive ? 'is-active' : '']" :class="['hamburger', props.isActive ? 'is-active' : '']"
viewBox="0 0 1024 1024" viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

3
vite.config.ts

@ -4,6 +4,7 @@ import svgLoader from "vite-svg-loader";
import legacy from "@vitejs/plugin-legacy"; import legacy from "@vitejs/plugin-legacy";
import vueJsx from "@vitejs/plugin-vue-jsx"; import vueJsx from "@vitejs/plugin-vue-jsx";
import { warpperEnv, regExps } from "./build"; import { warpperEnv, regExps } from "./build";
import fullReload from "vite-plugin-full-reload";
import { viteMockServe } from "vite-plugin-mock"; import { viteMockServe } from "vite-plugin-mock";
import ElementPlus from "unplugin-element-plus/vite"; import ElementPlus from "unplugin-element-plus/vite";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite"; import { UserConfigExport, ConfigEnv, loadEnv } from "vite";
@ -81,6 +82,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
vue(), vue(),
// jsx、tsx语法支持 // jsx、tsx语法支持
vueJsx(), vueJsx(),
// 修改layout文件夹下的文件时自动重载浏览器 解决 https://github.com/xiaoxian521/vue-pure-admin/issues/170
fullReload(["src/layout/**/*"]),
// 自定义主题 // 自定义主题
themePreprocessorPlugin({ themePreprocessorPlugin({
scss: { scss: {

Loading…
Cancel
Save