mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 17:31:02 +08:00
7173e402b7
* feat(components): [form-item] auto attach labels to inputs * feat(components): [form-item] auto-attach up through select * feat(components): [form-item] auto id complete for all inputs * feat(components): [form-item] fix lint, remove unused usePopper hook * feat(components): [form-item] PR comments
52 lines
1.5 KiB
Vue
52 lines
1.5 KiB
Vue
<template>
|
|
<el-form label-position="left" label-width="150px" style="max-width: 460px">
|
|
<el-space fill>
|
|
<el-alert type="info" show-icon :closable="false">
|
|
<p>"Full Name" label is automatically attached to the input:</p>
|
|
</el-alert>
|
|
<el-form-item label="Full Name">
|
|
<el-input v-model="formAccessibility.fullName" />
|
|
</el-form-item>
|
|
</el-space>
|
|
<el-space fill>
|
|
<el-alert type="info" show-icon :closable="false">
|
|
<p>
|
|
"Your Information" serves as a label for the group of inputs. <br />
|
|
You must specify labels on the individal inputs. Placeholders are not
|
|
replacements for using the "label" attribute.
|
|
</p>
|
|
</el-alert>
|
|
<el-form-item label="Your Information">
|
|
<el-row :gutter="20">
|
|
<el-col :span="12">
|
|
<el-input
|
|
v-model="formAccessibility.firstName"
|
|
label="First Name"
|
|
placeholder="First Name"
|
|
/>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-input
|
|
v-model="formAccessibility.lastName"
|
|
label="Last Name"
|
|
placeholder="Last Name"
|
|
/>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form-item>
|
|
</el-space>
|
|
</el-form>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { reactive, ref } from 'vue'
|
|
|
|
const labelPosition = ref('right')
|
|
|
|
const formAccessibility = reactive({
|
|
fullName: '',
|
|
firstName: '',
|
|
lastName: '',
|
|
})
|
|
</script>
|