fix: 修复 CRUD 列中 className 为 Object 时报错 (#3607)

* fix: 修复 CRUD 列中 className 为 Object 时报错

* 修复 coverage 时报错
This commit is contained in:
吴多益 2022-02-18 14:41:51 +08:00 committed by GitHub
parent ae905e12a4
commit f10e63fe9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ test('Form:options:autoFill', async () => {
{
type: 'form',
title: 'The form',
controls: [
body: [
{
type: 'radios',
name: 'a',
@ -38,19 +38,19 @@ test('Form:options:autoFill', async () => {
]
},
{
type: 'text',
type: 'input-text',
name: 'a'
},
{
type: 'text',
type: 'input-text',
name: 'aValue'
},
{
type: 'text',
type: 'input-text',
name: 'aLabel'
},
{
type: 'text',
type: 'input-text',
name: 'aId'
}
],
@ -80,7 +80,7 @@ test('Form:options:autoFill', async () => {
).toBe('233');
fireEvent.click(getByText(/OptionB/));
await wait(300);
await wait(500);
expect(container.querySelector('input[name=a]')?.getAttribute('value')).toBe(
'b'

View File

@ -212,7 +212,8 @@ export default {
value: '6'
}
]
}
},
classNameExpr: "<%= data.version < 5 ? 'bg-danger' : '' %>"
},
{
type: 'text',
@ -282,8 +283,7 @@ export default {
},
{
type: 'html',
html:
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
html: '<p>添加其他 <span>Html 片段</span> 需要支持变量替换todo.</p>'
}
]
}

View File

@ -54,7 +54,7 @@ export const Column = types
breakpoint: types.optional(types.frozen(), undefined),
pristine: types.optional(types.frozen(), undefined),
remark: types.optional(types.frozen(), undefined),
className: ''
className: types.union(types.string, types.frozen())
})
.actions(self => ({
toggleToggle() {