Browse Source
fix: 修改BasicForm表单的展开和收起按钮状态错误的bug (#2089) (#2109)
Co-authored-by: wjc <7098544231@qq.com>
pull/2112/head
wjc112233
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
1 deletions
-
src/components/Form/src/hooks/useAdvanced.ts
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import type { ColEx } from '../types'; |
|
|
|
import type { AdvanceState } from '../types/hooks'; |
|
|
|
import type { ComputedRef, Ref } from 'vue'; |
|
|
|
import { ComputedRef, getCurrentInstance, Ref } from 'vue'; |
|
|
|
import type { FormProps, FormSchema } from '../types/form'; |
|
|
|
import { computed, unref, watch } from 'vue'; |
|
|
|
import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is'; |
|
|
|
@ -26,6 +26,8 @@ export default function ({ |
|
|
|
formModel, |
|
|
|
defaultValueRef, |
|
|
|
}: UseAdvancedContext) { |
|
|
|
const vm = getCurrentInstance(); |
|
|
|
|
|
|
|
const { realWidthRef, screenEnum, screenRef } = useBreakpoint(); |
|
|
|
|
|
|
|
const getEmptySpan = computed((): number => { |
|
|
|
@ -150,6 +152,9 @@ export default function ({ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 确保页面发送更新
|
|
|
|
vm?.proxy?.$forceUpdate(); |
|
|
|
|
|
|
|
advanceState.actionSpan = (realItemColSum % BASIC_COL_LEN) + unref(getEmptySpan); |
|
|
|
|
|
|
|
getAdvanced(unref(getProps).actionColOptions || { span: BASIC_COL_LEN }, itemColSum, true); |
|
|
|
|