mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-04 04:08:34 +08:00
8c2868e72e
docs(components): beautify the demo
50 lines
1.7 KiB
Vue
50 lines
1.7 KiB
Vue
<template>
|
|
<el-form
|
|
:label-position="labelPosition"
|
|
label-width="auto"
|
|
:model="formLabelAlign"
|
|
style="max-width: 600px"
|
|
>
|
|
<el-form-item label="Form Align" label-position="right">
|
|
<el-radio-group v-model="labelPosition" aria-label="label position">
|
|
<el-radio-button value="left">Left</el-radio-button>
|
|
<el-radio-button value="right">Right</el-radio-button>
|
|
<el-radio-button value="top">Top</el-radio-button>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="Form Item Align" label-position="right">
|
|
<el-radio-group
|
|
v-model="itemLabelPosition"
|
|
aria-label="item label position"
|
|
>
|
|
<el-radio-button value="">Empty</el-radio-button>
|
|
<el-radio-button value="left">Left</el-radio-button>
|
|
<el-radio-button value="right">Right</el-radio-button>
|
|
<el-radio-button value="top">Top</el-radio-button>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
<el-form-item label="Name" :label-position="itemLabelPosition">
|
|
<el-input v-model="formLabelAlign.name" />
|
|
</el-form-item>
|
|
<el-form-item label="Activity zone" :label-position="itemLabelPosition">
|
|
<el-input v-model="formLabelAlign.region" />
|
|
</el-form-item>
|
|
<el-form-item label="Activity form" :label-position="itemLabelPosition">
|
|
<el-input v-model="formLabelAlign.type" />
|
|
</el-form-item>
|
|
</el-form>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { reactive, ref } from 'vue'
|
|
import type { FormItemProps, FormProps } from 'element-plus'
|
|
|
|
const labelPosition = ref<FormProps['labelPosition']>('right')
|
|
const itemLabelPosition = ref<FormItemProps['labelPosition']>('')
|
|
const formLabelAlign = reactive({
|
|
name: '',
|
|
region: '',
|
|
type: '',
|
|
})
|
|
</script>
|