tiny-vue/examples/sites/demos/pc/app/form/label-align.vue

50 lines
1.2 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="demo-form">
<div class="title">标签文字对齐 <tiny-switch v-model="isLabelAlign"></tiny-switch></div>
<tiny-form ref="ruleFormRef" :model="createData" label-position="left" :label-align="isLabelAlign">
<tiny-form-item label="用户名" prop="username" required>
<tiny-input v-model="createData.username"></tiny-input>
</tiny-form-item>
<tiny-form-item label="密码" prop="password" required>
<tiny-input v-model="createData.password" type="password" show-password></tiny-input>
</tiny-form-item>
<tiny-form-item label="密钥" prop="password2">
<tiny-input v-model="createData.password2" type="password" show-password></tiny-input>
</tiny-form-item>
</tiny-form>
</div>
</template>
<script>
import { Form, FormItem, Input, Switch } from '@opentiny/vue'
export default {
components: {
TinyForm: Form,
TinyFormItem: FormItem,
TinyInput: Input,
TinySwitch: Switch
},
data() {
return {
isLabelAlign: true,
createData: {
username: '',
password: '',
password2: ''
}
}
}
}
</script>
<style scoped>
.demo-form {
width: 380px;
}
.title {
margin-bottom: 20px;
font-size: 14px;
}
</style>