File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ data() {
145
145
``` js
146
146
props: [' size' ],
147
147
computed: {
148
- normalizedSize : function () {
148
+ normalizedSize () {
149
149
return this .size .trim ().toLowerCase ()
150
150
}
151
151
}
@@ -183,22 +183,22 @@ app.component('my-component', {
183
183
type: Object ,
184
184
// オブジェクトもしくは配列のデフォルト値は
185
185
// 必ずファクトリ関数(それを生み出すための関数)を返す必要があります。
186
- default : function () {
186
+ default () {
187
187
return { message: ' hello' }
188
188
}
189
189
},
190
190
// カスタムバリデーション関数
191
191
propF: {
192
- validator : function (value ) {
192
+ validator (value ) {
193
193
// プロパティの値は、必ずいずれかの文字列でなければならない
194
- return [' success' , ' warning' , ' danger' ].indexOf (value) !== - 1
194
+ return [' success' , ' warning' , ' danger' ].includes (value)
195
195
}
196
196
},
197
197
// デフォルト値つきの関数型
198
198
propG: {
199
199
type: Function ,
200
200
// オブジェクトや配列のデフォルトとは異なり、これはファクトリ関数ではありません。これは、デフォルト値としての関数を取り扱います。
201
- default : function () {
201
+ default () {
202
202
return ' Default function'
203
203
}
204
204
}
You can’t perform that action at this time.
0 commit comments