File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ data() {
145145``` js
146146props: [' size' ],
147147computed: {
148- normalizedSize : function () {
148+ normalizedSize () {
149149 return this .size .trim ().toLowerCase ()
150150 }
151151}
@@ -183,22 +183,22 @@ app.component('my-component', {
183183 type: Object ,
184184 // オブジェクトもしくは配列のデフォルト値は
185185 // 必ずファクトリ関数(それを生み出すための関数)を返す必要があります。
186- default : function () {
186+ default () {
187187 return { message: ' hello' }
188188 }
189189 },
190190 // カスタムバリデーション関数
191191 propF: {
192- validator : function (value ) {
192+ validator (value ) {
193193 // プロパティの値は、必ずいずれかの文字列でなければならない
194- return [' success' , ' warning' , ' danger' ].indexOf (value) !== - 1
194+ return [' success' , ' warning' , ' danger' ].includes (value)
195195 }
196196 },
197197 // デフォルト値つきの関数型
198198 propG: {
199199 type: Function ,
200200 // オブジェクトや配列のデフォルトとは異なり、これはファクトリ関数ではありません。これは、デフォルト値としての関数を取り扱います。
201- default : function () {
201+ default () {
202202 return ' Default function'
203203 }
204204 }
You can’t perform that action at this time.
0 commit comments