fix: fix Form component setProps not work bug

This commit is contained in:
kailong321200875
2022-01-30 11:09:53 +08:00
parent 33eca8a97d
commit 48ffc52ca8
7 changed files with 4582 additions and 4008 deletions

View File

@@ -54,13 +54,11 @@ export default defineComponent({
// useForm传入的props
const outsideProps = ref<FormProps>({})
const mergeProps = ref<FormProps>({})
const getProps = computed(() => {
const propsObj = { ...props }
for (const key in unref(outsideProps)) {
if (Reflect.has(propsObj, key)) {
propsObj[key] = unref(outsideProps)[key]
}
}
Object.assign(propsObj, unref(mergeProps))
return propsObj
})
@@ -77,6 +75,7 @@ export default defineComponent({
}
const setProps = (props: FormProps = {}) => {
mergeProps.value = Object.assign(unref(mergeProps), props)
outsideProps.value = props
}

View File

@@ -82,7 +82,22 @@ const bottonButtonStyle = computed(() => {
:schema="newSchema"
@register="register"
>
<template v-if="layout === 'inline'" #action>
<template #action>
<div v-if="layout === 'inline'">
<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>
</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') }}
@@ -91,16 +106,6 @@ const bottonButtonStyle = computed(() => {
<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">
<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>
</div>
</template>
</template>

View File

@@ -177,7 +177,7 @@ export const radarOption: EChartsOption = {
name: t('workplace.personal')
},
{
value: [50, 140, 28, 35, 90],
value: [50, 140, 290, 100, 90],
name: t('workplace.team')
}
]