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 @@ -44,8 +44,8 @@ export default {
44
44
45
45
または、単一ファイルコンポーネントの ` <template> ` を好む人向けに:
46
46
47
- ``` js
48
- // Vue 2 での <template> を使用した関数型コンポーネントの例
47
+ ``` vue
48
+ <!-- Vue 2 での <template> を使用した関数型コンポーネントの例 -->
49
49
<template functional>
50
50
<component
51
51
:is="`h${props.level}`"
@@ -87,14 +87,14 @@ export default DynamicHeading
87
87
88
88
### 単一ファイルコンポーネント (SFC)
89
89
90
- 3.x では、ステートフルコンポーネントと関数型コンポーネントのパフォーマンスの差は大幅に減少し、ほとんどのユースケースでは重要ではないでしょう。その結果、単一ファイルコンポーネントで ` functional ` を使用している開発者の移行方法は、その属性を削除することです。 追加の作業は必要ありません 。
90
+ 3.x では、ステートフルコンポーネントと関数型コンポーネントのパフォーマンスの差は大幅に減少し、ほとんどのユースケースでは重要ではないでしょう。その結果、単一ファイルコンポーネントで ` functional ` を使用している開発者の移行方法は、この属性を削除して、 ` props ` を ` $props ` に、 ` attrs ` を ` $attrs ` にすべての参照を変更することになります 。
91
91
92
92
先ほどの ` <dynamic-heading> ` の例を使うと、次のようになります。
93
93
94
- ``` js{1 }
94
+ ``` vue{1,3,4 }
95
95
<template>
96
96
<component
97
- v-bind:is="`h${props.level}`"
97
+ v-bind:is="`h${$ props.level}`"
98
98
v-bind="$attrs"
99
99
/>
100
100
</template>
You can’t perform that action at this time.
0 commit comments