From dc59513f3051b6b44fe14b8e93341fa610cadb7e Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Wed, 27 Jul 2022 11:53:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96codemirror=E4=B8=BB?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- src/modules/base/components/codemirror/index.vue | 7 ++++++- yarn.lock | 15 ++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 44f03ea..5f7a8c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.7.1", + "version": "5.7.2", "scripts": { "dev": "vite --host", "build": "vite build", @@ -30,7 +30,7 @@ "store": "^2.0.12", "unocss": "^0.44.3", "vue": "^3.2.37", - "vue-codemirror": "^6.0.0", + "vue-codemirror": "^6.0.1", "vue-echarts": "^6.2.3", "vue-router": "^4.1.2", "vuedraggable": "^4.1.0", diff --git a/src/modules/base/components/codemirror/index.vue b/src/modules/base/components/codemirror/index.vue index deec05e..cfb5e6f 100644 --- a/src/modules/base/components/codemirror/index.vue +++ b/src/modules/base/components/codemirror/index.vue @@ -8,6 +8,7 @@ indent-with-tab :tab-size="4" :extensions="extensions" + v-if="extensions.length > 0" @change="onChange" /> @@ -45,7 +46,11 @@ const emit = defineEmits(["update:modelValue", "change"]); const isDark = ref(useDark()); // 插件 -const extensions: any[] = [javascript(), isDark.value && oneDark]; +const extensions: any[] = [javascript()]; + +if (isDark.value) { + extensions.push(oneDark); +} // 内容 const content = ref(""); diff --git a/yarn.lock b/yarn.lock index 52dc59f..099bdd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2534,6 +2534,11 @@ csstype@^2.6.8: resolved "https://registry.npmjs.org/csstype/-/csstype-2.6.20.tgz#9229c65ea0b260cf4d3d997cb06288e36a8d6dda" integrity sha512-/WwNkdXfckNgw6S5R125rrW8ez139lBHWouiBvX8dfMFtcn6V81REDqnH7+CRpRipfYlyU1CmOnOxrmGcFOjeA== +csstype@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + dayjs@^1.11.3: version "1.11.4" resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.4.tgz#3b3c10ca378140d8917e06ebc13a4922af4f433e" @@ -5050,16 +5055,16 @@ vite@^3.0.2: optionalDependencies: fsevents "~2.3.2" -vue-codemirror@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/vue-codemirror/-/vue-codemirror-6.0.0.tgz#11c104603b99876839334ab26e9b1c29869cdbbb" - integrity sha512-1zYlS1l6Buxq0/PCw4gn2YQfWbINE0arEjtS/bZV1HcNMsgzotWbKmvRh9F+Ie0POX1F47gQricR731j4B/Ftw== +vue-codemirror@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/vue-codemirror/-/vue-codemirror-6.0.1.tgz#0d157a121053aaae89f79c3a95711381a70e3193" + integrity sha512-tEoaEFU2xZSADcfX0emHwGWXCZB8FEyoyUuGZmEPfLdTxK1nB+hp5WxFxuK7GWQxUD+2+bsAhJWT2IEaTbOpuQ== dependencies: "@codemirror/commands" "6.x" "@codemirror/language" "6.x" "@codemirror/state" "6.x" "@codemirror/view" "6.x" - csstype "^2.6.8" + csstype "^3.1.0" vue-demi@*, vue-demi@^0.13.2: version "0.13.5" From eef52f0975b7c0f1ac1293858e2a77e3f37120f2 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Thu, 28 Jul 2022 09:46:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/cool/types/index.d.ts | 2 +- src/modules/dict/config.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5f7a8c4..9f274fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.7.2", + "version": "5.7.3", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/cool/types/index.d.ts b/src/cool/types/index.d.ts index 4d5d7c7..73a982e 100644 --- a/src/cool/types/index.d.ts +++ b/src/cool/types/index.d.ts @@ -13,7 +13,7 @@ export declare interface ModuleConfig { onLoad?(events: { hasToken: (cb: () => Promise | void) => Promise | void; [key: string]: any; - }): Promise<{ [key: string]: any }> | void; + }): Promise<{ [key: string]: any }> | Promise | void; } export declare interface Module extends ModuleConfig { diff --git a/src/modules/dict/config.ts b/src/modules/dict/config.ts index 78f036c..24ddf36 100644 --- a/src/modules/dict/config.ts +++ b/src/modules/dict/config.ts @@ -3,11 +3,11 @@ import { useDict } from "./index"; export default (): ModuleConfig => { return { - onLoad({ hasToken }) { + async onLoad({ hasToken }) { const { dict } = useDict(); - hasToken(() => { - dict.refresh(); + await hasToken(async () => { + await dict.refresh(); }); } };