3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vue-validatorの対応バージョンメモ

Posted at

対応表(2016/01/28調べ)

Vue.js vue-validator
0.x 1.x
~1.0.13 動作するバージョンなし?
1.0.14~ 2.0.0-alpha.x

※詳細は未検証です。

最新バージョン(2016/01/28時点)

Vue.js vue-validator
1.0.15 2.0.0-alpha.16

インストール

 2016/01/28時点でvue-validatornpm install vue-validator するとインストールされるバージョンは 1.4.4 です。

package.json
"dependencies": {
  "vue-validator": "^1.4.4"
}

しかし、

vue-valudator 1.x is not working with VueJS 1.x. Use vue-validator 2.x.

らしい1ので、 2.x系のvue-validatorをインストールします。

$ npm install vue-validator@^2.0.0-alpha --save
とか
$ npm install vue-validator@2.0.0-alpha.16 --save
とか

もしくは

package.json
"dependencies": {
  "vue-validator": "^2.0.0-alpha"
}

と書いて、

$ npm install

 ただし、逆にvue-validator 2.x(というか2.0.0-alpha.16の時点で)は Vue.jsの1.0.14+が必須2なので、1.0.14未満を使用している場合は、1.0.14以上にアップデートしましょう。

[参考] 依存関係不整合時のエラー例

vue@1.0.12vue-validator@2.0.0-alpha.16 だと

Uncaught TypeError: Cannot read property 'push' of undefined

vue@1.0.12vue-validator@1.4.4 だと

Uncaught TypeError: Vue.parsers.directive.parse is not a function 
  1. https://github.com/vuejs/vue-validator/issues/124

  2. https://github.com/vuejs/vue-validator#requirements

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?