-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (84 loc) · 3.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>任务三十二:表单(四)实现表单自动生成工厂</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="main">
<div class="form-factory">
<div class="build" id="build">
<div class="form-group">
<label for="label">名 称</label>
<input type="text" name="label">
</div>
<div class="form-group">
<label for="type">类 型</label>
<input type="radio" name="type" value="text">
<sapn>普通文本</sapn>
<input type="radio" name="type" value="radio">
<span>单选</span>
<input type="radio" name="type" value="multi">
<span>多选</span>
</div>
<div id="radio-input"></div>
<div class="form-group">
<label for="validator">验证规则</label>
<sapn>用户名</sapn>
<input type="radio" name="validator" value="username">
<sapn>密码</sapn>
<input type="radio" name="validator" value="password">
<span>邮箱</span>
<input type="radio" name="validator" value="email">
<span>电话号码</span>
<input type="radio" name="validator" value="phone">
</div>
<div class="form-group">
<label for="rules">规则提示</label>
<input type="text" name="rules">
</div>
<div class="form-group">
<label for="success">验证通过提示</label>
<input type="text" name="success">
</div>
<div class="form-group">
<label for="fail">验证失败提示</label>
<input type="text" name="fail">
</div>
<div class="form-group">
<button id="build-form">生成表单</button>
</div>
</div>
<div class="delete">
<div class="form-group">
<label for="delete-name">删除选项</label>
<input type="text" name="delete-name">
</div>
<div class="form-group">
<button id="delete-form">删除表单</button>
</div>
</div>
</div>
<div class="form-result" id="form-result">
<p>thisi is result</p>
</div>
</div>
<script src="./app.js"></script>
</body>
</html>
{
'label': 'xxx',
// 1
'type': 'text',
'validator': 'xxx',
'rules': 'xxx',
'success': 'xxx',
'fail': 'xxx'
// 2
'type': 'radio',
'radioContent': {}a:'选项1', b:'选项2', c:'选项3'},
// 3
'type': 'multi',
'multiContent': {a:'选项1', b:'选项2', c:'选项3'}
}