File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed
Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 4343
4444- バリデーション
4545
46- - [ vee-validateを使う] ( )
46+ - [ vee-validateを使う] ( nuxt/vee-validate.md )
4747
4848- ヘルスチェック
4949
Original file line number Diff line number Diff line change 1+ ## VeeValidateの使い方
2+
3+ ## コンポーネントで使う場合
4+
5+ ` $validator ` を Inject します。
6+
7+ ``` javascript
8+ import { Validator } from ' vee-validator' ;
9+
10+ export default class extends Vue {
11+ @Inject public $validator: Validator;
12+ }
13+ ```
14+
15+ ## バケツリレーする系の中間コンポーネントで使う場合
16+
17+ ** ↑といっしょ!**
18+
19+ ## pageコンポーネントで使う場合
20+
21+ ` $_veeValidate ` でスコープを作成する
22+
23+ ``` javascript
24+ @Component ({
25+ $_veeValidate: {
26+ validator: ' new'
27+ }
28+ })
29+ export default class extends Vue {}
30+ ```
31+
32+ ## 何やってるの?
33+
34+ VeeValidate は ` $_veeValidate.validate ` で新しいスコープを作成することができ、
35+
36+ そのスコープ以下にあるバリデーション可能な箇所を参照できるようになるようです。
37+
38+ 参照可能にするコンポーネントでは ` $validator ` を ` @Inject ` すれば VeeValidate を利用できます。
39+
40+ ## VeeValidateのルール一覧
41+
42+ だいたいの validate が揃っているはずなので、ここから選んでください。
43+
44+ [ Validation Rules | VeeValidate] ( https://baianat.github.io/vee-validate/guide/rules.html )
45+
46+ また、日本語に関する validate は弱いので、自作する必要があります。
You can’t perform that action at this time.
0 commit comments