diff --git a/src/guide/component-props.md b/src/guide/component-props.md index 7dc9e409..44708079 100644 --- a/src/guide/component-props.md +++ b/src/guide/component-props.md @@ -145,7 +145,7 @@ data() { ```js props: ['size'], computed: { - normalizedSize: function () { + normalizedSize() { return this.size.trim().toLowerCase() } } @@ -183,22 +183,22 @@ app.component('my-component', { type: Object, // オブジェクトもしくは配列のデフォルト値は // 必ずファクトリ関数(それを生み出すための関数)を返す必要があります。 - default: function() { + default() { return { message: 'hello' } } }, // カスタムバリデーション関数 propF: { - validator: function(value) { + validator(value) { // プロパティの値は、必ずいずれかの文字列でなければならない - return ['success', 'warning', 'danger'].indexOf(value) !== -1 + return ['success', 'warning', 'danger'].includes(value) } }, // デフォルト値つきの関数型 propG: { type: Function, // オブジェクトや配列のデフォルトとは異なり、これはファクトリ関数ではありません。これは、デフォルト値としての関数を取り扱います。 - default: function() { + default() { return 'Default function' } }