Skip to content

Commit 8345b38

Browse files
committed
测试webhooks
1 parent aa7787f commit 8345b38

File tree

3 files changed

+53
-14
lines changed

3 files changed

+53
-14
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ LaySide,
2727
LayBody,
2828
LayFooter,
2929
LayBlock,
30-
```
30+
```
31+
32+
本文字用于测试webhooks

src/components/form/src/form-item.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<template>
22
<div class="layui-form-item "
33
:class="{
4-
'layui-form-pane': border
4+
'layui-form-pane': border,
5+
'is-error': isError,
6+
'is-required': isRequired,
57
}">
6-
<label v-if="label"
7-
class="layui-form-label"
8-
:class="{
9-
'is-required': isRequired
10-
}">{{label}}</label>
8+
<label v-if="label" class="layui-form-label">{{label}}</label>
119
<div :class="block ? 'layui-input-block' : 'layui-input-inline'">
1210
<slot>{{value}}</slot>
1311
</div>
@@ -68,7 +66,7 @@
6866
</script>
6967

7068
<style scoped>
71-
.is-required.layui-form-label:before {
69+
.is-required .layui-form-label:before {
7270
content: "*";
7371
color: #f56c6c;
7472
margin-right: 4px;
@@ -89,4 +87,8 @@
8987
margin-bottom: 22px;
9088
}
9189
90+
.is-error .layui-input {
91+
border-color: #FF5722!important;
92+
}
93+
9294
</style>

src/views/Form.vue

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
<template>
22
<div>
3+
4+
<lay-block>本模块与layui的验证方式完全不同。</lay-block>
5+
36
<lay-block title="表单集合演示"></lay-block>
47
<lay-form :model="form" :rules="rules" ref="form">
5-
<lay-form-item label="输入框" prop="name" block>
6-
<lay-input v-model="form.name" placeholder="占位"></lay-input>
8+
<lay-form-item label="单行输入框" prop="first" block>
9+
<lay-input v-model="form.first" placeholder="请输入标题"></lay-input>
10+
</lay-form-item>
11+
<lay-form-item label="验证必填项" prop="second" block>
12+
<lay-input v-model="form.second" placeholder="请输入"></lay-input>
713
</lay-form-item>
14+
15+
<lay-row>
16+
<lay-col :xs="4">
17+
<lay-form-item label="验证手机号" prop="mobile" block>
18+
<lay-input v-model="form.mobile" placeholder="请输入手机号"></lay-input>
19+
</lay-form-item>
20+
</lay-col>
21+
22+
<lay-col :xs="4">
23+
<lay-form-item label="验证邮箱" prop="email" block>
24+
<lay-input v-model="form.email" placeholder="请输入邮箱"></lay-input>
25+
</lay-form-item>
26+
</lay-col>
27+
28+
</lay-row>
29+
30+
31+
832
<lay-form-item type="" label="密码框" border :word-aux="input">
933
<lay-input disabled placeholder="禁用"></lay-input>
1034
</lay-form-item>
@@ -57,14 +81,25 @@
5781
data() {
5882
return {
5983
form: {
60-
name: 'lalal',
84+
first: '',
85+
second: '',
86+
mobile: '',
87+
email: '',
6188
checkbox: ['1', '4', '7']
6289
},
6390
rules: {
64-
name: [
65-
{type: "string", required: true, message: '请填写姓名'},
66-
{max: 10, message: '最多10个字符'}
91+
first: [
92+
{min: 5, message: '最少5个字符'}
93+
],
94+
second: [
95+
{type: "string", required: true, message: '此为必填项'},
96+
],
97+
mobile: [
98+
{pattern: /^[1][0-9]{10}$/,message: '手机号格式不正确'}
6799
],
100+
email: [
101+
{type: "email", message: '邮箱格式不正确'},
102+
],
68103
checkbox: [
69104
{type: "array", max: 2, message: '最多选2个'}
70105
]

0 commit comments

Comments
 (0)