.uk-layui-form
    form.layui-form.uk-form(action="/apps/profile/save.html", target="maincontent")
        input(type="hidden", name="id", value=userData.id)
        if index
            input(type="hidden", name="index", value=index)
        .layui-form-item
            label.layui-form-label 用户名：
            .layui-input-inline= userData.username
            .layui-form-mid.layui-word-aux 用户登录的账号
        .layui-form-item
            label.layui-form-label 姓名：
            .layui-input-inline
                input.layui-input(type="text", name="uname", value=userData.uname, required="", lay-verify="required", placeholder="请输入用户姓名", autocomplete="off")
        .layui-form-item
            label.layui-form-label 电子邮件：
            .layui-input-inline
                input.layui-input(type="email", name="email", value=userData.email, lay-verify="required email", placeholder="请输入电子邮件地址", autocomplete="off")
        .layui-form-item
            label.layui-form-label 密码：
            .layui-input-inline
                input#password.layui-input(type="password", name="password", placeholder="请输入登录密码", lay-verify="pass", autocomplete="off")
            .layui-form-mid.layui-word-aux(style="margin-top:5px")
                input#repassword.layui-input(type="password", name="repassword", lay-verify="repass", placeholder="请再次输入密码", autocomplete="off")
        .layui-form-item
            label.layui-form-label 手机号：
            .layui-input-inline
                input.layui-input(type="mobile", name="mobile", value=userData.mobile, placeholder="请输入手机号码", autocomplete="off")
        .layui-form-button
            .layui-button-block
                button.layui-btn(lay-submit="", lay-filter="profile") 立即提交
                button.layui-btn.layui-btn-original(type="reset") 重置

script.
    layui.use('form', function () {
        var form = layui.form();
        form.on('submit(*)', function (data) {
            layerhelper.close('mainajaxwin');
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        form.render(); //更新全部
        form.verify({
            repass: function (value) {
                if (value != $('#password').val()) {
                    return '两次输入的密码不一致，请确认';
                }
            }
        });
    });
