forked from opentiny/tiny-vue
fix(form): [form] fix dynamic change size fail in prod mode (#1857)
This commit is contained in:
parent
0a693e7b56
commit
4dbc4d3dfc
|
@ -26,7 +26,7 @@ test('测试表单禁用', async ({ page }) => {
|
|||
await expect(formItem.nth(5).locator('input').nth(1)).toBeDisabled()
|
||||
await expect(formItem.nth(6).locator('input').first()).toBeDisabled()
|
||||
await expect(formItem.nth(7).locator('input').first()).toBeDisabled()
|
||||
await expect(formItem.nth(8).locator('input')).toBeDisabled()
|
||||
await expect(formItem.nth(8).locator('input').first()).toBeDisabled()
|
||||
await expect(formItem.nth(9).locator('input')).toBeDisabled()
|
||||
await expect(formItem.nth(10).locator('input')).toBeDisabled()
|
||||
await expect(formItem.nth(11).locator('textarea')).toBeDisabled()
|
||||
|
@ -53,7 +53,7 @@ test('测试表单禁用', async ({ page }) => {
|
|||
await expect(formItem.nth(5).locator('input').nth(1)).not.toBeDisabled()
|
||||
await expect(formItem.nth(6).locator('input').first()).not.toBeDisabled()
|
||||
await expect(formItem.nth(7).locator('input').first()).not.toBeDisabled()
|
||||
await expect(formItem.nth(8).locator('input')).not.toBeDisabled()
|
||||
await expect(formItem.nth(8).locator('input').first()).not.toBeDisabled()
|
||||
await expect(formItem.nth(9).locator('input')).not.toBeDisabled()
|
||||
await expect(formItem.nth(10).locator('input')).not.toBeDisabled()
|
||||
await expect(formItem.nth(11).locator('textarea')).not.toBeDisabled()
|
||||
|
|
|
@ -129,8 +129,8 @@ export default defineComponent({
|
|||
typeof this.appendToBody === 'boolean'
|
||||
? this.appendToBody
|
||||
: typeof formAppendToBody === 'boolean'
|
||||
? formAppendToBody
|
||||
: true
|
||||
? formAppendToBody
|
||||
: true
|
||||
const validatePosition = this.validatePosition || state.formInstance?.validatePosition || 'top-end'
|
||||
|
||||
const popperOptions = {
|
||||
|
@ -160,7 +160,11 @@ export default defineComponent({
|
|||
let item = parseVnode(vnode)
|
||||
item.props = item.props || {}
|
||||
const { type } = item
|
||||
|
||||
// 修复production模式下动态切换size失败问题
|
||||
item.dynamicProps = item.dynamicProps || []
|
||||
if (!item.dynamicProps.includes('size')) {
|
||||
item.dynamicProps.push('size')
|
||||
}
|
||||
Object.assign(item.props, {
|
||||
size: state.formItemSize,
|
||||
mini: state.formItemSize === 'mini' || Boolean(item.props.mini)
|
||||
|
|
Loading…
Reference in New Issue