Skip to content

Commit 1cc673a

Browse files
authored
Migration > Functional Components の翻訳を追従 (#246)
* fix: functional component SFC example vuejs/docs@9c801e0#diff-b5fa5392e434ea0e0c8eda2c4e72d404db349a48372384d30f0ab2e6e27cde65 * Update functional-components.md vuejs/docs@93f7b01#diff-b5fa5392e434ea0e0c8eda2c4e72d404db349a48372384d30f0ab2e6e27cde65 * fix: change the language on some code blocks to match the code vuejs/docs@0391e2e#diff-b5fa5392e434ea0e0c8eda2c4e72d404db349a48372384d30f0ab2e6e27cde65
1 parent e08bda5 commit 1cc673a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/guide/migration/functional-components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export default {
4444

4545
または、単一ファイルコンポーネントの `<template>` を好む人向けに:
4646

47-
```js
48-
// Vue 2 での <template> を使用した関数型コンポーネントの例
47+
```vue
48+
<!-- Vue 2 での <template> を使用した関数型コンポーネントの例 -->
4949
<template functional>
5050
<component
5151
:is="`h${props.level}`"
@@ -87,14 +87,14 @@ export default DynamicHeading
8787

8888
### 単一ファイルコンポーネント (SFC)
8989

90-
3.x では、ステートフルコンポーネントと関数型コンポーネントのパフォーマンスの差は大幅に減少し、ほとんどのユースケースでは重要ではないでしょう。その結果、単一ファイルコンポーネントで `functional` を使用している開発者の移行方法は、その属性を削除することです。 追加の作業は必要ありません
90+
3.x では、ステートフルコンポーネントと関数型コンポーネントのパフォーマンスの差は大幅に減少し、ほとんどのユースケースでは重要ではないでしょう。その結果、単一ファイルコンポーネントで `functional` を使用している開発者の移行方法は、この属性を削除して、 `props``$props` に、 `attrs``$attrs` にすべての参照を変更することになります
9191

9292
先ほどの `<dynamic-heading>` の例を使うと、次のようになります。
9393

94-
```js{1}
94+
```vue{1,3,4}
9595
<template>
9696
<component
97-
v-bind:is="`h${props.level}`"
97+
v-bind:is="`h${$props.level}`"
9898
v-bind="$attrs"
9999
/>
100100
</template>

0 commit comments

Comments
 (0)