<script type="text/html" template lay-done="layui.data.done(d);">
    <div class="layui-form coreshop-form" lay-filter="LAY-app-CoreCmsUserGrade-createForm" id="LAY-app-CoreCmsUserGrade-createForm">

        <div class="layui-form-item">
            <label for="title" class="layui-form-label">标题</label>
            <div class="layui-input-inline">
                <input name="title" id="title" lay-verify="required|verifytitle" class="layui-input" lay-reqText="请输入【标题】" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="isDefault" class="layui-form-label">是否默认</label>
            <div class="layui-input-inline">
                <input type="checkbox" lay-filter="switch" name="isDefault" id="isDefault" lay-skin="switch" lay-text="关闭|开启">
            </div>
            <div class="layui-inline">
                <div class="layui-form-mid layui-word-aux"></div>
            </div>
        </div>

        <div class="layui-form-item core-hidden">
            <label class="layui-form-label"></label>
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserGrade-createForm-submit" id="LAY-app-CoreCmsUserGrade-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    layui.data.done = function (d) {
        layui.use(['admin', 'form', 'laydate', 'coreHelper'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , coreHelper = layui.coreHelper;

                form.verify({

                    verifytitle: [/^[\S]{0,60}$/, '标题最大只允许输入60位字符，且不能出现空格'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsUserGrade-createForm');
            })
    };
</script>