From d88e0514349e877f1c5280a48f9b1bd2bfd622bf Mon Sep 17 00:00:00 2001
From: kailong321200875 <321200875@qq.com>
Date: Thu, 9 Jun 2022 20:27:54 +0800
Subject: [PATCH 1/2] fix: fix tagsview not work
---
package.json | 30 +++---
src/components/TagsView/src/TagsView.vue | 54 +++++-----
src/views/Components/Form/DefaultForm.vue | 116 +++++++++++-----------
3 files changed, 101 insertions(+), 99 deletions(-)
diff --git a/package.json b/package.json
index c8b1655..a5ebb73 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"axios": "^0.27.2",
"echarts": "^5.3.2",
"echarts-wordcloud": "^2.0.0",
- "element-plus": "2.2.4",
+ "element-plus": "2.2.5",
"intro.js": "^5.1.0",
"lodash-es": "^4.17.21",
"mitt": "^3.0.0",
@@ -44,7 +44,7 @@
"pinia": "^2.0.14",
"pinia-plugin-persist": "^1.0.0",
"qrcode": "^1.5.0",
- "qs": "^6.10.3",
+ "qs": "^6.10.5",
"url": "^0.11.0",
"vue": "3.2.37",
"vue-i18n": "9.1.10",
@@ -55,44 +55,44 @@
"devDependencies": {
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
- "@iconify/json": "^2.1.57",
+ "@iconify/json": "^2.1.58",
"@intlify/vite-plugin-vue-i18n": "^3.4.0",
"@purge-icons/generated": "^0.8.1",
"@types/intro.js": "^3.0.2",
"@types/lodash-es": "^4.17.6",
- "@types/node": "^17.0.40",
+ "@types/node": "^17.0.41",
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.2",
"@types/qs": "^6.9.7",
- "@typescript-eslint/eslint-plugin": "^5.27.0",
- "@typescript-eslint/parser": "^5.27.0",
+ "@typescript-eslint/eslint-plugin": "^5.27.1",
+ "@typescript-eslint/parser": "^5.27.1",
"@vitejs/plugin-vue": "^2.3.3",
"@vitejs/plugin-vue-jsx": "^1.3.10",
"autoprefixer": "^10.4.7",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
- "eslint-define-config": "^1.5.0",
+ "eslint-define-config": "^1.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.1.0",
"husky": "^8.0.1",
- "less": "^4.1.2",
- "lint-staged": "^13.0.0",
+ "less": "^4.1.3",
+ "lint-staged": "^13.0.1",
"plop": "^3.1.0",
"postcss": "^8.4.14",
"postcss-html": "^1.4.1",
"postcss-less": "^6.0.0",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
- "rollup": "^2.75.5",
- "stylelint": "^14.8.5",
+ "rollup": "^2.75.6",
+ "stylelint": "^14.9.0",
"stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3",
- "stylelint-config-recommended": "^7.0.0",
- "stylelint-config-standard": "^25.0.0",
+ "stylelint-config-recommended": "^8.0.0",
+ "stylelint-config-standard": "^26.0.0",
"stylelint-order": "^5.0.0",
"typescript": "4.7.3",
"unplugin-vue-define-options": "^0.6.1",
- "vite": "2.9.9",
+ "vite": "2.9.10",
"vite-plugin-eslint": "^1.6.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6",
@@ -100,7 +100,7 @@
"vite-plugin-style-import": "^1.4.1",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-windicss": "^1.8.4",
- "vue-tsc": "^0.36.1",
+ "vue-tsc": "^0.37.3",
"windicss": "^3.5.4",
"windicss-analysis": "^0.3.5"
},
diff --git a/src/components/TagsView/src/TagsView.vue b/src/components/TagsView/src/TagsView.vue
index 2edcc50..bf51619 100644
--- a/src/components/TagsView/src/TagsView.vue
+++ b/src/components/TagsView/src/TagsView.vue
@@ -347,32 +347,34 @@ watch(
]"
@visible-change="visibleChange"
>
-
-
-
- {{ t(item?.meta?.title as string) }}
-
-
-
+
+
+
+
+ {{ t(item?.meta?.title as string) }}
+
+
+
+
diff --git a/src/views/Components/Form/DefaultForm.vue b/src/views/Components/Form/DefaultForm.vue
index 9c270ac..238dd06 100644
--- a/src/views/Components/Form/DefaultForm.vue
+++ b/src/views/Components/Form/DefaultForm.vue
@@ -43,26 +43,26 @@ onMounted(() => {
restaurants.value = loadAll()
})
-// const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
-// const options = ref(
-// Array.from({ length: 1000 }).map((_, idx) => ({
-// value: `Option ${idx + 1}`,
-// label: `${initials[idx % 10]}${idx}`
-// }))
-// )
-// const options2 = ref(
-// Array.from({ length: 10 }).map((_, idx) => {
-// const label = idx + 1
-// return {
-// value: `Group ${label}`,
-// label: `Group ${label}`,
-// options: Array.from({ length: 10 }).map((_, idx) => ({
-// value: `Option ${idx + 1 + 10 * label}`,
-// label: `${initials[idx % 10]}${idx + 1 + 10 * label}`
-// }))
-// }
-// })
-// )
+const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
+const options = ref(
+ Array.from({ length: 1000 }).map((_, idx) => ({
+ value: `Option ${idx + 1}`,
+ label: `${initials[idx % 10]}${idx}`
+ }))
+)
+const options2 = ref(
+ Array.from({ length: 10 }).map((_, idx) => {
+ const label = idx + 1
+ return {
+ value: `Group ${label}`,
+ label: `Group ${label}`,
+ options: Array.from({ length: 10 }).map((_, idx) => ({
+ value: `Option ${idx + 1 + 10 * label}`,
+ label: `${initials[idx % 10]}${idx + 1 + 10 * label}`
+ }))
+ }
+ })
+)
const options3: ComponentOptions[] = [
{
@@ -558,44 +558,44 @@ const schema = reactive([
label: `${t('formDemo.selectV2')}`,
component: 'Divider'
},
- // {
- // field: 'field19',
- // label: t('formDemo.default'),
- // component: 'SelectV2',
- // componentProps: {
- // options: options.value
- // }
- // }
- // {
- // field: 'field20',
- // label: t('formDemo.slot'),
- // component: 'SelectV2',
- // componentProps: {
- // options: options.value,
- // slots: {
- // default: true
- // }
- // }
- // }
- // {
- // field: 'field21',
- // label: t('formDemo.selectGroup'),
- // component: 'SelectV2',
- // componentProps: {
- // options: options2.value
- // }
- // },
- // {
- // field: 'field22',
- // label: `${t('formDemo.selectGroup')}${t('formDemo.slot')}`,
- // component: 'SelectV2',
- // componentProps: {
- // options: options2.value,
- // slots: {
- // default: true
- // }
- // }
- // },
+ {
+ field: 'field19',
+ label: t('formDemo.default'),
+ component: 'SelectV2',
+ componentProps: {
+ options: options.value
+ }
+ },
+ {
+ field: 'field20',
+ label: t('formDemo.slot'),
+ component: 'SelectV2',
+ componentProps: {
+ options: options.value,
+ slots: {
+ default: true
+ }
+ }
+ },
+ {
+ field: 'field21',
+ label: t('formDemo.selectGroup'),
+ component: 'SelectV2',
+ componentProps: {
+ options: options2.value
+ }
+ },
+ {
+ field: 'field22',
+ label: `${t('formDemo.selectGroup')}${t('formDemo.slot')}`,
+ component: 'SelectV2',
+ componentProps: {
+ options: options2.value,
+ slots: {
+ default: true
+ }
+ }
+ },
{
field: 'field23',
label: t('formDemo.cascader'),
From 586486a68d4bf2a024e50a79945b4007324f642d Mon Sep 17 00:00:00 2001
From: kailong321200875 <321200875@qq.com>
Date: Thu, 9 Jun 2022 20:31:51 +0800
Subject: [PATCH 2/2] types: fix types error
---
src/components/index.ts | 4 ++--
src/plugins/elementPlus/index.ts | 6 +++---
src/plugins/vueI18n/index.ts | 6 +++---
src/router/index.ts | 6 +++---
src/store/index.ts | 6 +++---
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/components/index.ts b/src/components/index.ts
index 0458c18..4d030c3 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -1,6 +1,6 @@
-import type { AppContext } from 'vue'
+import type { App } from 'vue'
import { Icon } from './Icon'
-export const setupGlobCom = (app: AppContext['app']): void => {
+export const setupGlobCom = (app: App): void => {
app.component('Icon', Icon)
}
diff --git a/src/plugins/elementPlus/index.ts b/src/plugins/elementPlus/index.ts
index f2a226f..a5362a1 100644
--- a/src/plugins/elementPlus/index.ts
+++ b/src/plugins/elementPlus/index.ts
@@ -1,13 +1,13 @@
-import type { AppContext, Plugin } from 'vue'
+import type { App } from 'vue'
// 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题
import { ElLoading, ElScrollbar } from 'element-plus'
-const plugins = [ElLoading] as Plugin[]
+const plugins = [ElLoading]
const components = [ElScrollbar]
-export const setupElementPlus = (app: AppContext['app']) => {
+export const setupElementPlus = (app: App) => {
plugins.forEach((plugin) => {
app.use(plugin)
})
diff --git a/src/plugins/vueI18n/index.ts b/src/plugins/vueI18n/index.ts
index b2adae4..f845b13 100644
--- a/src/plugins/vueI18n/index.ts
+++ b/src/plugins/vueI18n/index.ts
@@ -1,4 +1,4 @@
-import type { AppContext, Plugin } from 'vue'
+import type { App } from 'vue'
import { createI18n } from 'vue-i18n'
import { useLocaleStoreWithOut } from '@/store/modules/locale'
import type { I18n, I18nOptions } from 'vue-i18n'
@@ -35,8 +35,8 @@ const createI18nOptions = async (): Promise => {
}
}
-export const setupI18n = async (app: AppContext['app']) => {
+export const setupI18n = async (app: App) => {
const options = await createI18nOptions()
i18n = createI18n(options) as I18n
- app.use(i18n as Plugin)
+ app.use(i18n)
}
diff --git a/src/router/index.ts b/src/router/index.ts
index 8db4242..97bdc0a 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -1,6 +1,6 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
-import type { AppContext, Plugin } from 'vue'
+import type { App } from 'vue'
import { Layout, getParentLayout } from '@/utils/routerHelper'
import { useI18n } from '@/hooks/web/useI18n'
@@ -552,8 +552,8 @@ export const resetRouter = (): void => {
})
}
-export const setupRouter = (app: AppContext['app']) => {
- app.use(router as Plugin)
+export const setupRouter = (app: App) => {
+ app.use(router)
}
export default router
diff --git a/src/store/index.ts b/src/store/index.ts
index 9dca73e..4038068 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -1,4 +1,4 @@
-import type { AppContext, Plugin } from 'vue'
+import type { App } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
@@ -6,8 +6,8 @@ const store = createPinia()
store.use(piniaPluginPersist)
-export const setupStore = (app: AppContext['app']) => {
- app.use(store as Plugin)
+export const setupStore = (app: App) => {
+ app.use(store)
}
export { store }