From c2b207dd5172519a87cb23e34114e5d104ce56a1 Mon Sep 17 00:00:00 2001 From: vben Date: Wed, 10 Nov 2021 23:24:03 +0800 Subject: [PATCH 1/6] fix: Fix stylelint does not support html files --- .gitpod.yml | 2 +- .husky/lintstagedrc.js | 8 -------- index.html | 27 +++++++++++++-------------- package.json | 26 +++++++++++++++++++++++++- stylelint.config.js | 3 ++- 5 files changed, 41 insertions(+), 25 deletions(-) delete mode 100644 .husky/lintstagedrc.js diff --git a/.gitpod.yml b/.gitpod.yml index 51f4bdcb..866381fc 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,4 +3,4 @@ ports: onOpen: open-preview tasks: - init: pnpm install - command: pnpm dev + command: pnpm run dev diff --git a/.husky/lintstagedrc.js b/.husky/lintstagedrc.js deleted file mode 100644 index 08d8c9e8..00000000 --- a/.husky/lintstagedrc.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'], - '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'], - 'package.json': ['prettier --write'], - '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'], - '*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'], - '*.md': ['prettier --write'], -}; diff --git a/index.html b/index.html index 5b99faf6..25d1cd72 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,6 @@ name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" /> - <%= title %> @@ -30,7 +29,7 @@ } html[data-theme='dark'] .app-loading .app-loading-title { - color: rgba(255, 255, 255, 0.85); + color: rgb(255 255 255 / 85%); } .app-loading { @@ -48,7 +47,7 @@ top: 50%; left: 50%; display: flex; - -webkit-transform: translate3d(-50%, -50%, 0); + transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0); justify-content: center; align-items: center; @@ -66,7 +65,7 @@ display: flex; margin-top: 30px; font-size: 30px; - color: rgba(0, 0, 0, 0.85); + color: rgb(0 0 0 / 85%); justify-content: center; align-items: center; } @@ -97,7 +96,7 @@ height: 20px; background-color: #0065cc; border-radius: 100%; - opacity: 0.3; + opacity: 30%; transform: scale(0.75); animation: antSpinMove 1s infinite linear alternate; transform-origin: 50% 50%; @@ -111,43 +110,43 @@ .dot i:nth-child(2) { top: 0; right: 0; - -webkit-animation-delay: 0.4s; + animation-delay: 0.4s; animation-delay: 0.4s; } .dot i:nth-child(3) { right: 0; bottom: 0; - -webkit-animation-delay: 0.8s; + animation-delay: 0.8s; animation-delay: 0.8s; } .dot i:nth-child(4) { bottom: 0; left: 0; - -webkit-animation-delay: 1.2s; + animation-delay: 1.2s; animation-delay: 1.2s; } @keyframes antRotate { to { - -webkit-transform: rotate(405deg); + transform: rotate(405deg); transform: rotate(405deg); } } - @-webkit-keyframes antRotate { + @keyframes antRotate { to { - -webkit-transform: rotate(405deg); + transform: rotate(405deg); transform: rotate(405deg); } } @keyframes antSpinMove { to { - opacity: 1; + opacity: 100%; } } - @-webkit-keyframes antSpinMove { + @keyframes antSpinMove { to { - opacity: 1; + opacity: 100%; } } diff --git a/package.json b/package.json index bf7eb794..6e55a124 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock}/**/*.{vue,ts,tsx}\" --fix", "lint:prettier": "prettier --write \"src/**/*.{js,json,tsx,css,less,scss,vue,html,md}\"", "lint:stylelint": "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/", - "lint:lint-staged": "lint-staged -c ./.husky/lintstagedrc.js", + "lint:lint-staged": "lint-staged", "test:unit": "jest", "test:unit-coverage": "jest --coverage", "test:gzip": "npx http-server dist --cors --gzip -c-1", @@ -159,5 +159,29 @@ "homepage": "https://github.com/anncwb/vue-vben-admin", "engines": { "node": "^12 || >=14" + }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": [ + "eslint --fix", + "prettier --write" + ], + "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ + "prettier --write--parser json" + ], + "package.json": [ + "prettier --write" + ], + "*.vue": [ + "eslint --fix", + "prettier --write", + "stylelint --fix" + ], + "*.{scss,less,styl,html}": [ + "stylelint --fix", + "prettier --write" + ], + "*.md": [ + "prettier --write" + ] } } diff --git a/stylelint.config.js b/stylelint.config.js index 26bc40c6..4216a961 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -71,9 +71,10 @@ module.exports = { ignoreFiles: ['**/*.js', '**/*.jsx', '**/*.tsx', '**/*.ts'], overrides: [ { - files: ['*.vue', '**/*.vue'], + files: ['*.vue', '**/*.vue', '*.html', '**/*.html'], extends: ['stylelint-config-recommended', 'stylelint-config-html'], rules: { + 'keyframes-name-pattern': null, 'selector-pseudo-class-no-unknown': [ true, { From 013cb7f16bb8ccb6606d57371c68d5f7f16017e3 Mon Sep 17 00:00:00 2001 From: CXM <16154023+littlecxm@users.noreply.github.com> Date: Thu, 11 Nov 2021 22:18:22 +0800 Subject: [PATCH 2/6] fix: fix base64 blob (#1356) * fix(type): fix ant-design-vue -> * fix: fix base64 blob --- src/utils/file/base64Conver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/file/base64Conver.ts b/src/utils/file/base64Conver.ts index d77618a0..6751d977 100644 --- a/src/utils/file/base64Conver.ts +++ b/src/utils/file/base64Conver.ts @@ -5,7 +5,7 @@ export function dataURLtoBlob(base64Buf: string): Blob { const arr = base64Buf.split(','); const typeItem = arr[0]; const mime = typeItem.match(/:(.*?);/)![1]; - const bstr = atob(arr[1]); + const bstr = window.atob(arr[1]); let n = bstr.length; const u8arr = new Uint8Array(n); while (n--) { From 090d8440147f044f8b2659488b0c95f99c357398 Mon Sep 17 00:00:00 2001 From: vben Date: Thu, 11 Nov 2021 22:28:39 +0800 Subject: [PATCH 3/6] fix: type, #1347 --- index.html | 6 ------ src/utils/dateUtil.ts | 2 +- windi.config.ts | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 25d1cd72..f615e97c 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,6 @@ left: 50%; display: flex; transform: translate3d(-50%, -50%, 0); - transform: translate3d(-50%, -50%, 0); justify-content: center; align-items: center; flex-direction: column; @@ -111,32 +110,27 @@ top: 0; right: 0; animation-delay: 0.4s; - animation-delay: 0.4s; } .dot i:nth-child(3) { right: 0; bottom: 0; animation-delay: 0.8s; - animation-delay: 0.8s; } .dot i:nth-child(4) { bottom: 0; left: 0; animation-delay: 1.2s; - animation-delay: 1.2s; } @keyframes antRotate { to { transform: rotate(405deg); - transform: rotate(405deg); } } @keyframes antRotate { to { transform: rotate(405deg); - transform: rotate(405deg); } } @keyframes antSpinMove { diff --git a/src/utils/dateUtil.ts b/src/utils/dateUtil.ts index 1ea97249..5502b6bf 100644 --- a/src/utils/dateUtil.ts +++ b/src/utils/dateUtil.ts @@ -4,7 +4,7 @@ import moment from 'moment'; const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'; -const DATE_FORMAT = 'YYYY-MM-DD '; +const DATE_FORMAT = 'YYYY-MM-DD'; export function formatToDateTime( date: moment.MomentInput = undefined, diff --git a/windi.config.ts b/windi.config.ts index ff1aba23..4733d46a 100644 --- a/windi.config.ts +++ b/windi.config.ts @@ -27,7 +27,7 @@ export default defineConfig({ * Used for animation when the element is displayed * @param maxOutput The larger the maxOutput output, the larger the generated css volume */ -function createEnterPlugin(maxOutput = 7) { +function createEnterPlugin(maxOutput = 6) { const createCss = (index: number, d = 'x') => { const upd = d.toUpperCase(); return { From 7e00488635b2de4c79520759b5f7dc561a732a70 Mon Sep 17 00:00:00 2001 From: handsomeFu Date: Mon, 15 Nov 2021 09:32:01 +0800 Subject: [PATCH 4/6] chore: Update extensions.json (#1359) Use volar instead of vetur --- .vscode/extensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0af47dea..94dc8139 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ - "octref.vetur", + "johnsoncodehk.volar", "dbaeumer.vscode-eslint", "stylelint.vscode-stylelint", "esbenp.prettier-vscode", From b3c4002b69af100cb637da2aae8e1757fe51f0a0 Mon Sep 17 00:00:00 2001 From: Coderclc <64017460+Coderclc@users.noreply.github.com> Date: Mon, 15 Nov 2021 09:32:14 +0800 Subject: [PATCH 5/6] fix: Fix setting hideMenu, bread bar jump problem (#1358) --- src/layouts/default/header/components/Breadcrumb.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/default/header/components/Breadcrumb.vue b/src/layouts/default/header/components/Breadcrumb.vue index 9f2e77b7..67266d2e 100644 --- a/src/layouts/default/header/components/Breadcrumb.vue +++ b/src/layouts/default/header/components/Breadcrumb.vue @@ -101,8 +101,8 @@ if (!meta) { return !!name; } - const { title, hideBreadcrumb } = meta; - if (!title || hideBreadcrumb) { + const { title, hideBreadcrumb, hideMenu } = meta; + if (!title || hideBreadcrumb || hideMenu) { return false; } return true; From 3b3f6c903a5070ec225c9ec9ab20f16d1bdc3caa Mon Sep 17 00:00:00 2001 From: nsk <50975307+niesk@users.noreply.github.com> Date: Mon, 15 Nov 2021 18:59:28 +0800 Subject: [PATCH 6/6] fix: some mistakes close #1349, close #1250 close#1245 (#1373) * fix(Loading): add theme prop, The repair background prop does not take effect * fix(AppLogo): fix title line height * fix(Table,Upload): fix #1349 #1250 #1245 --- .../src/components/settings/ColumnSetting.vue | 22 +++++++++---------- src/components/Table/src/hooks/useColumns.ts | 20 +++++------------ src/components/Upload/src/UploadModal.vue | 10 ++------- 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index 24e42d4d..db0e124e 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -43,7 +43,7 @@