<link rel="stylesheet" href="/app/admin/component/layui-v2.6.8/css/layui.css" />
<script src="/app/admin/admin/js/jquery1.2.3.js"></script>
<script src="/app/admin/component/layui-v2.6.8/layui.js"></script>
<div class="layui-form-item">
<label class="layui-form-label required">详情</label>
<div class="layui-input-block">
<textarea id="detail" lay-verify="detail" name="detail" ></textarea>
</div>
</div>
<!--新增-->
layui.use(['form','layedit'], function () {
var form = layui.form;
form.render();
layui.use(['layedit', 'form'], function () {
var form = layui.form;
var layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/app/admin/upload/image',
}
});
var index = layedit.build('detail');
form.verify({
detail: function (value) {
return layedit.sync(index);
}
});
});
});
<!--修改-->
layui.use(['form','layedit'], function () {
var form = layui.form;
form.render();
layui.use(['layedit', 'form'], function () {
var form = layui.form;
var layedit = layui.layedit;
layedit.set({
uploadImage: {
url: '/app/admin/upload/image',
}
});
var index = layedit.build('detail');
form.verify({
detail: function (value) {
return layedit.sync(index);
}
});
});
});