<script type="text/html" template lay-done="layui.data.done(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsArticleType-createForm" id="LAY-app-CoreCmsArticleType-createForm">
        <input type="hidden" value="0" name="parentId" />

        <div class="layui-form-item">
            <label for="name" class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input name="name" id="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" lay-reqText="请输入分类名称" placeholder="请输入分类名称" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="sort" class="layui-form-label">排序 </label>
            <div class="layui-input-block">
                <input type="number" min="0" max="999999" name="sort" id="sort" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入排序 " lay-reqText="请输入排序 并为数字" />
            </div>
        </div>

        <div class="layui-form-item text-right">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsArticleType-createForm-submit" id="LAY-app-CoreCmsArticleType-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.done = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;

                form.verify({

                    verifyname: [/^[\S]{0,32}$/, '分类名称最大只允许输入32位字符，且不能出现空格'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsArticleType-createForm');
            })
    };
</script>