Closed xjchengo closed 8 years ago
Thank you feedback!!
Yeah!! You're right 😃
We need to support these methods ($resetValidation()
, $validate()
, etc,).
@kazupon I have written some code to improve these methods. But I am stuck with debug and unit test. How to debug the plugin during development?
npm run dev
throws:
ERROR in multi main
Module not found: Error: Cannot resolve 'file' or 'directory' ./index.js in /home/vagrant/Projects/vuejs-vue-validator
@ multi main
When I run npm run dev-test
in Windows 8 and open the test page in browser, console shows:
.*$:31 Uncaught Error: Cannot find module './sinon/util/core'.
and some esline errors:
C:\Users\Xujian\Projects\xjchengo-vue-validator\test\specs\validators.js
171:38 error Unnecessary escape character: \' no-useless-escape
177:38 error Unnecessary escape character: \" no-useless-escape
In ubuntu, sinon
works fine. But all top level event related tests failed with:.
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
at eval (eval at <anonymous> (specs.js:8427:9), <anonymous>:4190:19)
I found that handler.apply
at https://github.com/vuejs/vue-validator/blob/dev/src/validator.js#L384 just return the event handler. Handler must be applied twice to make it executed.
Can you give me some tips to solve these problem? Thanks.
npm run dev
I use the to develop feature driven (prototype browser base) development. I recommend that you develop with using the npm run dev-test
or npm run unit
.
When I run npm run dev-test in Windows 8 and open the test page in browser, console shows:
I have not been able to confirm whether it is possible development at windows yet.
if you want to develop soon, I recommend that you develop with using vagrant
or docker
at the OS like the UNIX environment.
and some esline errors: C:\Users\Xujian\Projects\xjchengo-vue-validator\test\specs\validators.js 171:38 error Unnecessary escape character: \' no-useless-escape 177:38 error Unnecessary escape character: \" no-useless-escape
and
But all top level event related tests failed with:. Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. at eval (eval at
(specs.js:8427:9), :4190:19) I found that handler.apply at https://github.com/vuejs/vue-validator/blob/dev/src/validator.js#L384 just return the event handler. Handler must be applied twice to make it executed.
I'll try to check the later.
Thanks!!
In Mac OS X, there is no eslint error and all test are passed.
I'll try to implement at v3.0.
@kazupon Is there a workaround to manually validate a specific validator?
released v3.0.0-alpha.1 https://github.com/vuejs/vue-validator/releases/tag/v3.0.0-alpha.1
In 3.0 later, valuable method (validate, reset, etc...) is scoped with validity component.
Currently, we can define multiple validators with different names under same vm. In most case, this works well except when calls
$resetValidation()
,$activateValidator()
etc. These methods just work on last validator. If multiple validators under same vm need to be supported, these methods should add a param indicating which validator it works on.