mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-21 02:50:11 +08:00
fix(components): [form] label-position props default value (#7838)
This commit is contained in:
parent
769148b780
commit
4ae21b0632
@ -210,6 +210,14 @@ describe('Form', () => {
|
|||||||
<Input v-model={form.address} />
|
<Input v-model={form.address} />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
<Form model={form} ref="labelRight">
|
||||||
|
<FormItem>
|
||||||
|
<Input v-model={form.name} />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem>
|
||||||
|
<Input v-model={form.address} />
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -220,6 +228,9 @@ describe('Form', () => {
|
|||||||
expect(wrapper.findComponent({ ref: 'labelLeft' }).classes()).toContain(
|
expect(wrapper.findComponent({ ref: 'labelLeft' }).classes()).toContain(
|
||||||
'el-form--label-left'
|
'el-form--label-left'
|
||||||
)
|
)
|
||||||
|
expect(wrapper.findComponent({ ref: 'labelRight' }).classes()).toContain(
|
||||||
|
'el-form--label-right'
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('label size', () => {
|
it('label size', () => {
|
||||||
|
@ -16,7 +16,11 @@ export const formProps = buildProps({
|
|||||||
rules: {
|
rules: {
|
||||||
type: definePropType<FormRules>(Object),
|
type: definePropType<FormRules>(Object),
|
||||||
},
|
},
|
||||||
labelPosition: String,
|
labelPosition: {
|
||||||
|
type: String,
|
||||||
|
values: ['left', 'right', 'top'] as const,
|
||||||
|
default: 'right',
|
||||||
|
},
|
||||||
labelWidth: {
|
labelWidth: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: '',
|
default: '',
|
||||||
|
Loading…
Reference in New Issue
Block a user