diff --git a/packages/components/form/__tests__/form.test.tsx b/packages/components/form/__tests__/form.test.tsx index 1d2a5131d2..196630a054 100644 --- a/packages/components/form/__tests__/form.test.tsx +++ b/packages/components/form/__tests__/form.test.tsx @@ -210,6 +210,14 @@ describe('Form', () => { +
+ + + + + + +
) }, @@ -220,6 +228,9 @@ describe('Form', () => { expect(wrapper.findComponent({ ref: 'labelLeft' }).classes()).toContain( 'el-form--label-left' ) + expect(wrapper.findComponent({ ref: 'labelRight' }).classes()).toContain( + 'el-form--label-right' + ) }) it('label size', () => { diff --git a/packages/components/form/src/form.ts b/packages/components/form/src/form.ts index 98a2ac6119..00fa1c6a8a 100644 --- a/packages/components/form/src/form.ts +++ b/packages/components/form/src/form.ts @@ -16,7 +16,11 @@ export const formProps = buildProps({ rules: { type: definePropType(Object), }, - labelPosition: String, + labelPosition: { + type: String, + values: ['left', 'right', 'top'] as const, + default: 'right', + }, labelWidth: { type: [String, Number], default: '',