Open z1haze opened 7 years ago
sorry, for the late response. can you share the minimum reproduction code please?
Inside the route object data function calling this.$resetValidation() sorry I'm on my phone but I believe that's was the gist of it
Sent from my iPhone, sorry about the typos.
On Sep 22, 2016, at 1:39 PM, kazuya kawaguchi notifications@github.com wrote:
sorry, for the late response. can you share the minimum reproduction code please?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
我也遇到了这个问题,弹出框第二次进入的时候我将数据清空,但是错误提示依然显示
BaseValidation.prototype.reset = function reset() { this.resetValidationNoopable(); this.resetFlags(); this._init = this._getValue(this._el); }; 查看源码发现BaseValidation的reset方法只重置了通用的flag,没有重置各个校验器的校验结果flag所以用来显示error的布尔值依然是上次校验的结果或者修改表单值触发校验的结果,现在我只能手动将所有值重置来恢复状态非常麻烦,希望能解决 `
I am trying to figure out how to reset a validator on my page? I am using vue-router, and I have the same component being used for 2 different routes, a create, and edit route. The component just shows a form, one route shows an empty form, one route shows a populated form.
My issue is that when i visit the /edit route that prepopulates the form, the next time i visit the /create route which has an empty form, its already showing validation errors, even though I havent touched it yet.
I tried using $this.resetValidation() in the route object's data function (that is fired everything the route is hit), but it does nothing. Please advise!