BootstrapValidator引发的too much recursion

简介: 版权声明:欢迎转载,请注明沉默王二原创。 https://blog.csdn.net/qing_gee/article/details/49180703 自从使用了BootstrapValidator之后,感觉非常漂亮,但却引发了很多个bug,too much recursion就是其中一种。
版权声明:欢迎转载,请注明沉默王二原创。 https://blog.csdn.net/qing_gee/article/details/49180703

自从使用了BootstrapValidator之后,感觉非常漂亮,但却引发了很多个bug,too much recursion就是其中一种。

错误代码

<label>账户</label>
<input class="form-control" type="text" autofocus name="username" placeholder="请输入会员编号" autocomplete="off"
    data-bv-notempty />
<label>密码</label>
<input class="form-control" type="password" name="password"  placeholder="请输入登陆密码" data-bv-notempty/>
<div class="checkbox">
    <label> <input type="checkbox" value="1" /> 记住我的账号
    </label>
</div>

这样的写法对于BootstrapValidator是不符合规则的,虽然这样的写法看起并没有什么错误,但运行的时候就会提示too much recursion错误,那么经过多番调试后,发现,如果要使用BootstrapValidator,那么对于上面代码中的“账户label”和“账户 input”就必须加入到一个class为“form-group”的div中。

正确代码

<div class="form-group">
    <div class="row">
        <label>账户</label>
        <input class="form-control" type="text" autofocus name="username" placeholder="请输入会员编号" autocomplete="off"
            data-bv-notempty />
    </div>
</div>

<div class="form-group">
    <div class="row">
        <label>密码</label>
        <input class="form-control" type="password" name="password" autocomplete="off" data-bv-notempty placeholder="请输入登陆密码" />
    </div>
</div>

<div class="form-group">
    <div class="row">
        <div class="checkbox">
            <label> <input type="checkbox" value="1" /> 记住我的账号
            </label>
        </div>
    </div>
</div>
<div class="form-group">
    <div class="row">
        <button class="btn btn-lg btn-primary btn-block" type="submit">提交</button>
    </div>
</div>

相关文章

笑对现实的无奈,不能后退的时候,不再傍徨的时候,永远向前 路一直都在──陈奕迅《路一直都在》
本文出自:【沉默王二的博客

相关文章
|
5月前
|
JavaScript
鬼火起~为什么报错[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the
鬼火起~为什么报错[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the
|
5月前
|
小程序 JavaScript
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
Avoid mutating a prop directly since the value will be overwritten whenever the parent comp
|
5月前
|
人工智能
L - MaratonIME doesn't like odd numbers
L - MaratonIME doesn't like odd numbers
|
10月前
|
前端开发 JavaScript
bootstrapValidator的使用
bootstrapValidator的使用
47 0
|
12月前
|
Python
Indirect recursion
Indirect recursion 是指在函数调用中,函数体内部调用另一个函数,而这个被调用的函数又调用了该函数本身,形成了递归调用。这种递归调用是通过间接的方式实现的,因此被称为间接递归。 使用间接递归可以使代码更加简洁和易于理解。例如,考虑一个计算阶乘的函数,使用直接递归的实现方式会比较复杂,而使用间接递归则可以很简单地实现。
49 5
|
10月前
Error:Elements in iteration expect to have ‘v-bind:key‘ directives
Error:Elements in iteration expect to have ‘v-bind:key‘ directives
|
11月前
ReferenceError: document is not defined
ReferenceError: document is not defined
45 0
|
12月前
hdoj 4706 Children's Day
题目意思就是用a-z组成一个N,然后到z后又跳回a,输出宽从3到10的N。
45 0
|
JavaScript 前端开发 API
什么是 custom elements
什么是 custom elements
|
JavaScript
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent .(一)
大致意思就是props接收到的从父组件传过来的tableData不能直接修改。