Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

vue validate timing is affected by other vue data in the area of the validate rule incharging #333

Open
tywei90 opened this issue Oct 29, 2016 · 1 comment

Comments

@tywei90
Copy link

tywei90 commented Oct 29, 2016

               <div class="f-fr">
                        <input id="userName"
                            type="text"
                            name="userName"
                            placeholder="请输入您的账号"
                            v-model="userName"
                            initial="off"
                            detect-change="off"
                            detect-blur="on"
                            @valid="onUsernameValid"
                            v-validate:user-name="['userRule']">
                        <label for="userName" v-if="$loginValidator.userName.userRule &&                   userName!==''">
                            <i class="icon iconfont icon-cuowu"></i>
                            <span>4~16个字符,支持小写英文数字和下划线,请以英文字母开头</span>
                        </label>
              </div>

i set the timing on blur, but if i add '&& userName!==''' logic to the rule, then it would change its validate timing when the v-model value userName changes. when i want to implement a complicated input case, it makes me crazy! when you put the logic userName!=='' inside the such as on or , it's the same case

tywei90 added a commit to tywei90/CMS-of-Blog that referenced this issue Oct 29, 2016
1、增加登录注册页点击首页logo回首页功能
2、修改注册页用户名错误同时提示bug,优化用户名正确给提示
3、优化用户名和手机input获得焦点错误消失
ps:vue的validate有bug(详见:kazupon/vue-validator#333
@tywei90
Copy link
Author

tywei90 commented Nov 1, 2016

can anybody answer this question?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants