Skip to content

Commit 26320c3

Browse files
committed
docs(form): [form] optimize demo and docs
1 parent c363512 commit 26320c3

11 files changed

+23
-18
lines changed

examples/sites/demos/pc/app/form/form-validation-composition-api.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tiny-form-item label="邮件" prop="email">
2020
<tiny-input v-model="createData.email"></tiny-input>
2121
</tiny-form-item>
22-
<tiny-form-item label="Numeric字段" prop="num1">
22+
<tiny-form-item label="数字" prop="num1">
2323
<tiny-numeric v-model="createData.num1"></tiny-numeric>
2424
</tiny-form-item>
2525
<tiny-form-item label="IP字段" prop="ip">

examples/sites/demos/pc/app/form/form-validation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tiny-form-item label="邮件" prop="email">
2020
<tiny-input v-model="createData.email"></tiny-input>
2121
</tiny-form-item>
22-
<tiny-form-item label="Numeric字段" prop="num1">
22+
<tiny-form-item label="数字" prop="num1">
2323
<tiny-numeric v-model="createData.num1"></tiny-numeric>
2424
</tiny-form-item>
2525
<tiny-form-item label="IP字段" prop="ip">

examples/sites/demos/pc/app/form/label-position-composition-api.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="title">
44
标签位置: <tiny-button-group :data="labelPositionList" v-model="labelPositionValue"></tiny-button-group>
55
</div>
6-
<tiny-form ref="ruleFormRef" :model="createData" :label-position="labelPositionValue" label-width="60px">
6+
<tiny-form ref="ruleFormRef" :model="createData" :label-position="labelPositionValue">
77
<tiny-form-item label="用户名" prop="username">
88
<tiny-input v-model="createData.username"></tiny-input>
99
</tiny-form-item>

examples/sites/demos/pc/app/form/label-position.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="title">
44
标签位置: <tiny-button-group :data="labelPositionList" v-model="labelPositionValue"></tiny-button-group>
55
</div>
6-
<tiny-form ref="ruleFormRef" :model="createData" :label-position="labelPositionValue" label-width="60px">
6+
<tiny-form ref="ruleFormRef" :model="createData" :label-position="labelPositionValue">
77
<tiny-form-item label="用户名" prop="username">
88
<tiny-input v-model="createData.username"></tiny-input>
99
</tiny-form-item>

examples/sites/demos/pc/app/form/popper-options-composition-api.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ function submitClick() {
4040

4141
<style scoped>
4242
.demo-form {
43-
width: 380px;
43+
width: 420px;
4444
}
4545
.scroll-parent {
4646
height: 200px;
4747
overflow: auto;
48+
padding-right: 40px;
4849
}
4950
</style>

examples/sites/demos/pc/app/form/popper-options.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ export default {
5050

5151
<style scoped>
5252
.demo-form {
53-
width: 380px;
53+
width: 420px;
5454
}
5555
.scroll-parent {
5656
height: 200px;
5757
overflow: auto;
58+
padding-right: 40px;
5859
}
5960
</style>

examples/sites/demos/pc/app/form/slot-label-composition-api.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="demo-form">
3-
<tiny-form ref="ruleFormRef" :model="createData" :rules="rules" label-width="100px" show-message>
3+
<tiny-form ref="ruleFormRef" :model="createData" :rules="rules" label-width="100px">
44
<tiny-form-item prop="users">
55
<template #label> 必填 </template>
66
<tiny-input v-model="createData.users"></tiny-input>
@@ -11,7 +11,7 @@
1111
</tiny-form-item>
1212
<tiny-form-item prop="url">
1313
<template #label>
14-
<div class="custom-label">超过两行文字,省略显示</div>
14+
<div class="custom-label" v-auto-tip>超过两行文字,省略显示</div>
1515
</template>
1616
<tiny-input v-model="createData.url"></tiny-input>
1717
</tiny-form-item>
@@ -37,6 +37,7 @@ import {
3737
Modal,
3838
RadioGroup as TinyRadioGroup
3939
} from '@opentiny/vue'
40+
import { AutoTip as VAutoTip } from '@opentiny/vue-directive'
4041
4142
function handleClick() {
4243
Modal.message({ message: 'click', status: 'info' })

examples/sites/demos/pc/app/form/slot-label.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="demo-form">
3-
<tiny-form ref="ruleFormRef" :model="createData" :rules="rules" label-width="100px" show-message>
3+
<tiny-form ref="ruleFormRef" :model="createData" :rules="rules" label-width="100px">
44
<tiny-form-item prop="users">
55
<template #label> 必填 </template>
66
<tiny-input v-model="createData.users"></tiny-input>
@@ -11,7 +11,7 @@
1111
</tiny-form-item>
1212
<tiny-form-item prop="url">
1313
<template #label>
14-
<div class="custom-label">超过两行文字,省略显示</div>
14+
<div class="custom-label" v-auto-tip>超过两行文字,省略显示</div>
1515
</template>
1616
<tiny-input v-model="createData.url"></tiny-input>
1717
</tiny-form-item>
@@ -28,6 +28,7 @@
2828

2929
<script>
3030
import { Form, FormItem, Input, DatePicker, Button, Modal, RadioGroup } from '@opentiny/vue'
31+
import { AutoTip } from '@opentiny/vue-directive'
3132
3233
export default {
3334
components: {
@@ -38,6 +39,7 @@ export default {
3839
TinyButton: Button,
3940
TinyRadioGroup: RadioGroup
4041
},
42+
directives: { AutoTip },
4143
data() {
4244
return {
4345
options: [

examples/sites/demos/pc/app/form/smb-required-composition-api.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:hide-required-asterisk="hideRequiredAsterisk"
1010
:model="createData"
1111
:rules="rules"
12-
label-width="100px"
12+
label-width="108px"
1313
validate-type="text"
1414
message-type="block"
1515
>
@@ -36,7 +36,6 @@ import {
3636
FormItem as TinyFormItem,
3737
Input as TinyInput,
3838
Button as TinyButton,
39-
Modal,
4039
Switch as TinySwitch
4140
} from '@opentiny/vue'
4241
@@ -59,6 +58,7 @@ function handleSubmit() {
5958
})
6059
}
6160
</script>
61+
6262
<style scoped>
6363
.demo-form {
6464
width: 380px;

examples/sites/demos/pc/app/form/smb-required.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:hide-required-asterisk="hideRequiredAsterisk"
1010
:model="createData"
1111
:rules="rules"
12-
label-width="100px"
12+
label-width="108px"
1313
validate-type="text"
1414
message-type="block"
1515
>
@@ -30,7 +30,7 @@
3030
</template>
3131

3232
<script>
33-
import { Form, FormItem, Input, Button, Modal, Switch } from '@opentiny/vue'
33+
import { Form, FormItem, Input, Button, Switch } from '@opentiny/vue'
3434
3535
export default {
3636
components: {

0 commit comments

Comments
 (0)