fix: fix Form component setProps not work bug
This commit is contained in:
parent
33eca8a97d
commit
48ffc52ca8
30
package.json
30
package.json
|
@ -25,19 +25,19 @@
|
||||||
"postinstall": "husky install"
|
"postinstall": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iconify/iconify": "^2.1.1",
|
"@iconify/iconify": "^2.1.2",
|
||||||
"@vueuse/core": "^7.5.4",
|
"@vueuse/core": "^7.5.5",
|
||||||
"@zxcvbn-ts/core": "^1.2.0",
|
"@zxcvbn-ts/core": "^1.2.0",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"echarts": "^5.2.2",
|
"echarts": "^5.3.0",
|
||||||
"echarts-wordcloud": "^2.0.0",
|
"echarts-wordcloud": "^2.0.0",
|
||||||
"element-plus": "1.3.0-beta.7",
|
"element-plus": "1.3.0-beta.9",
|
||||||
"intro.js": "^4.3.0",
|
"intro.js": "^4.3.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"pinia": "^2.0.9",
|
"pinia": "^2.0.10",
|
||||||
"qrcode": "^1.5.0",
|
"qrcode": "^1.5.0",
|
||||||
"qs": "^6.10.3",
|
"qs": "^6.10.3",
|
||||||
"vue": "3.2.26",
|
"vue": "3.2.26",
|
||||||
|
@ -49,36 +49,36 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^16.1.0",
|
"@commitlint/cli": "^16.1.0",
|
||||||
"@commitlint/config-conventional": "^16.0.0",
|
"@commitlint/config-conventional": "^16.0.0",
|
||||||
"@iconify/json": "^1.1.459",
|
"@iconify/json": "^2.0.30",
|
||||||
"@intlify/vite-plugin-vue-i18n": "^3.2.1",
|
"@intlify/vite-plugin-vue-i18n": "^3.2.1",
|
||||||
"@purge-icons/generated": "^0.7.0",
|
"@purge-icons/generated": "^0.7.0",
|
||||||
"@types/intro.js": "^3.0.2",
|
"@types/intro.js": "^3.0.2",
|
||||||
"@types/lodash-es": "^4.17.5",
|
"@types/lodash-es": "^4.17.5",
|
||||||
"@types/node": "^17.0.10",
|
"@types/node": "^17.0.13",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
"@types/qrcode": "^1.4.2",
|
"@types/qrcode": "^1.4.2",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||||
"@typescript-eslint/parser": "^5.10.0",
|
"@typescript-eslint/parser": "^5.10.1",
|
||||||
"@vitejs/plugin-vue": "^2.1.0",
|
"@vitejs/plugin-vue": "^2.1.0",
|
||||||
"@vitejs/plugin-vue-jsx": "^1.3.3",
|
"@vitejs/plugin-vue-jsx": "^1.3.3",
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"commitizen": "^4.2.4",
|
"commitizen": "^4.2.4",
|
||||||
"eslint": "^8.7.0",
|
"eslint": "^8.8.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-define-config": "^1.2.3",
|
"eslint-define-config": "^1.2.3",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-vue": "^8.3.0",
|
"eslint-plugin-vue": "^8.4.0",
|
||||||
"husky": "^7.0.4",
|
"husky": "^7.0.4",
|
||||||
"less": "^4.1.2",
|
"less": "^4.1.2",
|
||||||
"lint-staged": "^12.2.2",
|
"lint-staged": "^12.3.2",
|
||||||
"postcss": "^8.4.5",
|
"postcss": "^8.4.5",
|
||||||
"postcss-html": "^1.3.0",
|
"postcss-html": "^1.3.0",
|
||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
"prettier": "^2.5.1",
|
"prettier": "^2.5.1",
|
||||||
"pretty-quick": "^3.1.3",
|
"pretty-quick": "^3.1.3",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"stylelint": "^14.2.0",
|
"stylelint": "^14.3.0",
|
||||||
"stylelint-config-html": "^1.0.0",
|
"stylelint-config-html": "^1.0.0",
|
||||||
"stylelint-config-prettier": "^9.0.3",
|
"stylelint-config-prettier": "^9.0.3",
|
||||||
"stylelint-config-standard": "^24.0.0",
|
"stylelint-config-standard": "^24.0.0",
|
||||||
|
@ -89,8 +89,8 @@
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.6",
|
||||||
"vite-plugin-purge-icons": "^0.7.0",
|
"vite-plugin-purge-icons": "^0.7.0",
|
||||||
"vite-plugin-style-import": "^1.4.1",
|
"vite-plugin-style-import": "^1.4.1",
|
||||||
"vite-plugin-svg-icons": "^1.1.0",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-vue-setup-extend": "^0.3.0",
|
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||||
"vite-plugin-windicss": "^1.6.3",
|
"vite-plugin-windicss": "^1.6.3",
|
||||||
"vue-tsc": "^0.31.1",
|
"vue-tsc": "^0.31.1",
|
||||||
"windicss": "^3.4.3",
|
"windicss": "^3.4.3",
|
||||||
|
|
8511
pnpm-lock.yaml
8511
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -54,13 +54,11 @@ export default defineComponent({
|
||||||
// useForm传入的props
|
// useForm传入的props
|
||||||
const outsideProps = ref<FormProps>({})
|
const outsideProps = ref<FormProps>({})
|
||||||
|
|
||||||
|
const mergeProps = ref<FormProps>({})
|
||||||
|
|
||||||
const getProps = computed(() => {
|
const getProps = computed(() => {
|
||||||
const propsObj = { ...props }
|
const propsObj = { ...props }
|
||||||
for (const key in unref(outsideProps)) {
|
Object.assign(propsObj, unref(mergeProps))
|
||||||
if (Reflect.has(propsObj, key)) {
|
|
||||||
propsObj[key] = unref(outsideProps)[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return propsObj
|
return propsObj
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -77,6 +75,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
const setProps = (props: FormProps = {}) => {
|
const setProps = (props: FormProps = {}) => {
|
||||||
|
mergeProps.value = Object.assign(unref(mergeProps), props)
|
||||||
outsideProps.value = props
|
outsideProps.value = props
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,18 +82,8 @@ const bottonButtonStyle = computed(() => {
|
||||||
:schema="newSchema"
|
:schema="newSchema"
|
||||||
@register="register"
|
@register="register"
|
||||||
>
|
>
|
||||||
<template v-if="layout === 'inline'" #action>
|
<template #action>
|
||||||
<ElButton v-if="showSearch" type="primary" @click="search">
|
<div v-if="layout === 'inline'">
|
||||||
<Icon icon="ep:search" class="mr-5px" />
|
|
||||||
{{ t('common.query') }}
|
|
||||||
</ElButton>
|
|
||||||
<ElButton v-if="showReset" @click="reset">
|
|
||||||
<Icon icon="ep:refresh-right" class="mr-5px" />
|
|
||||||
{{ t('common.reset') }}
|
|
||||||
</ElButton>
|
|
||||||
</template>
|
|
||||||
</Form>
|
|
||||||
<div v-if="layout === 'bottom'" :style="bottonButtonStyle">
|
|
||||||
<ElButton v-if="showSearch" type="primary" @click="search">
|
<ElButton v-if="showSearch" type="primary" @click="search">
|
||||||
<Icon icon="ep:search" class="mr-5px" />
|
<Icon icon="ep:search" class="mr-5px" />
|
||||||
{{ t('common.query') }}
|
{{ t('common.query') }}
|
||||||
|
@ -103,4 +93,19 @@ const bottonButtonStyle = computed(() => {
|
||||||
{{ t('common.reset') }}
|
{{ t('common.reset') }}
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
<template v-if="layout === 'bottom'">
|
||||||
|
<div :style="bottonButtonStyle">
|
||||||
|
<ElButton v-if="showSearch" type="primary" @click="search">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" />
|
||||||
|
{{ t('common.query') }}
|
||||||
|
</ElButton>
|
||||||
|
<ElButton v-if="showReset" @click="reset">
|
||||||
|
<Icon icon="ep:refresh-right" class="mr-5px" />
|
||||||
|
{{ t('common.reset') }}
|
||||||
|
</ElButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -177,7 +177,7 @@ export const radarOption: EChartsOption = {
|
||||||
name: t('workplace.personal')
|
name: t('workplace.personal')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: [50, 140, 28, 35, 90],
|
value: [50, 140, 290, 100, 90],
|
||||||
name: t('workplace.team')
|
name: t('workplace.team')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
"vite/client",
|
"vite/client",
|
||||||
"element-plus/global",
|
"element-plus/global",
|
||||||
"@types/intro.js",
|
"@types/intro.js",
|
||||||
"@types/qrcode"
|
"@types/qrcode",
|
||||||
|
"vite-plugin-svg-icons/client"
|
||||||
],
|
],
|
||||||
"typeRoots": ["./node_modules/@types/", "./types"]
|
"typeRoots": ["./node_modules/@types/", "./types"]
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@ import VueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import EslintPlugin from 'vite-plugin-eslint'
|
import EslintPlugin from 'vite-plugin-eslint'
|
||||||
import VueI18n from '@intlify/vite-plugin-vue-i18n'
|
import VueI18n from '@intlify/vite-plugin-vue-i18n'
|
||||||
import StyleImport, { ElementPlusResolve } from 'vite-plugin-style-import'
|
import StyleImport, { ElementPlusResolve } from 'vite-plugin-style-import'
|
||||||
import ViteSvgIcons from 'vite-plugin-svg-icons'
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
||||||
import PurgeIcons from 'vite-plugin-purge-icons'
|
import PurgeIcons from 'vite-plugin-purge-icons'
|
||||||
import { viteMockServe } from 'vite-plugin-mock'
|
import { viteMockServe } from 'vite-plugin-mock'
|
||||||
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
|
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
|
||||||
|
@ -53,7 +53,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
||||||
compositionOnly: true,
|
compositionOnly: true,
|
||||||
include: [resolve(__dirname, 'src/locales/**')]
|
include: [resolve(__dirname, 'src/locales/**')]
|
||||||
}),
|
}),
|
||||||
ViteSvgIcons({
|
createSvgIconsPlugin({
|
||||||
iconDirs: [pathResolve('src/assets/svgs')],
|
iconDirs: [pathResolve('src/assets/svgs')],
|
||||||
symbolId: 'icon-[dir]-[name]',
|
symbolId: 'icon-[dir]-[name]',
|
||||||
svgoOptions: true
|
svgoOptions: true
|
||||||
|
|
Loading…
Reference in New Issue