-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.html
36 lines (35 loc) · 1.07 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>三级联动生成器插件</title>
</head>
<body>
<div class="container"></div>
<script src="./dist/select-plugin-all.js"></script>
<script>
// 不传任何参数
new Select();
// 自定义数据
var data = {
One: ['a1', 'a2', 'a3'],
Two: [
['a11', 'a12', 'a13'],
['a21', 'a22'],
['a31', 'a32']
],
Three: [
[['a111', 'a112'], ['a121', 'a122'], ['a131', 'a132']],
[['a211', 'a212'], ['a221', 'a222']],
[['a311'], ['a312']]
]
};
var id = ['one', 'two', 'three'];
var text = ['选项1', '选项2', '选项3'];
// 参数依次是插入父容器位置,数据,DOM的id,显示的文本
new Select('.container', data, id, text);
</script>
</body>
</html>