This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
84 lines (77 loc) · 3.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>laymd</title>
<link rel="stylesheet" href="layui/css/layui.css">
</head>
<body style="padding: 15px;">
<div>
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label">长输入框</label>
<div class="layui-input-block">
<input type="text" name="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">短输入框</label>
<div class="layui-input-inline">
<input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">日期选择</label>
<div class="layui-input-block">
<input type="text" name="date" id="date1" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">行内表单</label>
<div class="layui-input-inline">
<input type="text" name="number" autocomplete="off" class="layui-input">
</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">密码</label>
<div class="layui-input-inline">
<input type="password" name="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">请务必填写用户名</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">文本域</label>
<div class="layui-input-block">
<textarea placeholder="请输入内容" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item" pane="">
<div id="demo"># 初始数据放这里</div>
</div>
<div class="layui-form-item">
<button type="button" class="layui-btn" id="c">跳转式提交</button>
</div>
</form>
</div>
</body>
<script src="layui/layui.js"></script>
<script src="laymd/marked.min.js"></script>
<script>
layui.config({base: 'laymd/'}).use(['layer', 'laymd'], function(){
var $ = layui.$,
layer = layui.layer,
laymd = layui.laymd;
//实例化编辑器,可以多个实例
var md = laymd.init('demo', {});
//内容改变事件
md.on('change', function () {
//这里借用marked.js解析效率比HyperDown快,用户可自行找解析器
this.setPreview(marked(this.getText()));
});
//初始化数据预览
md.do('change');
});
</script>
</html>