File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
> このページは [ コンポーネントの基本] ( component-basics.md ) が読まれていることが前提となっています。 コンポーネントを扱った事のない場合はこちらのページを先に読んでください。
4
4
5
- プロパティでない属性とは、コンポーネントに渡される属性やイベントリスナのうち、[ props] ( component-props ) や [ emits] ( component-custom-events.html#defining-custom-events ) で定義されたものを除いたものをいいます。なお、共通の認識として ` class ` や ` style ` , ` id ` 属性はここに含まれません 。
5
+ プロパティでない属性とは、コンポーネントに渡される属性やイベントリスナのうち、[ props] ( component-props ) や [ emits] ( component-custom-events.html#defining-custom-events ) で定義されたものを除いたものをいいます。よくある例としては、コンポーネント要素タグに付与する ` class ` 、 ` style ` 、 ` id ` などの属性があります 。
6
6
7
7
## 属性の継承
8
8
@@ -80,9 +80,9 @@ const app = Vue.createApp({
80
80
81
81
コンポーネントのオプション内で、` inheritAttrs: false ` を指定することで、属性の継承を ** 無効化** することも可能です。
82
82
83
- 一般的に属性の無効化は 、ルート要素ではない別の要素に属性を適用したいようなケースで利用される場面が考えられるでしょう。
83
+ 一般的に属性の継承の無効化は 、ルート要素ではない別の要素に属性を適用したいようなケースで利用される場面が考えられるでしょう。
84
84
85
- ` inheritAttrs ` を ` false ` にセットした場合、コンポーネントの ` $attrs ` プロパティを通じて 、` props ` や ` emits ` といったコンポーネントのプロパティを除く全ての属性(例えば` class ` や ` style ` 、 ` v-on ` といったものも)にアクセスできるようになります 。
85
+ ` inheritAttrs ` を ` false ` にセットした場合属性の形象化は無効化されますが、 ` inheritAttrs ` の設定に関わらずコンポーネントの ` $attrs ` プロパティから 、` props ` や ` emits ` といったコンポーネントのプロパティを除く全ての属性(例えば` class ` や ` style ` 、 ` v-on ` といったものも)にアクセススルことができます 。
86
86
87
87
[ 前節] ( '#属性の継承 ) で利用した date-picker のコンポーネント例を用いて、プロパティでない属性の全てを ルートの ` div ` 要素ではなく ` input ` 要素に適用する場合、` v-bind ` を用いて簡略的に記述することも可能です。
88
88
You can’t perform that action at this time.
0 commit comments