File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 11---
2- title : Props Default Function this Access
2+ title : プロパティのデフォルト値ファクトリ関数の ` this` アクセス
33badges :
44 - breaking
55---
66
7- # Props Default Function ` this ` Access <MigrationBadges :badges =" $frontmatter.badges " />
7+ # プロパティのデフォルト値ファクトリ関数の ` this ` アクセス <MigrationBadges :badges =" $frontmatter.badges " />
88
9- Props default value factory functions no longer have access to ` this ` .
9+ プロパティのデフォルト値ファクトリ関数が ` this ` にアクセスできなくなりました。
1010
11- Instead:
11+ 代わりの方法は以下です。
1212
13- - Raw props received by the component are passed to the default function as argument;
13+ - コンポーネントが受け取った生のプロパティは、引数としてデフォルト関数に渡されます。
1414
15- - The [ inject] ( ../composition-api-provide-inject.md ) API can be used inside default functions.
15+ - [ inject] ( ../composition-api-provide-inject.md ) API がデフォルト関数の内部で使用できます。
1616
1717``` js
1818import { inject } from ' vue'
@@ -21,9 +21,9 @@ export default {
2121 props: {
2222 theme: {
2323 default (props ) {
24- // `props` is the raw values passed to the component,
25- // before any type / default coercions
26- // can also use `inject` to access injected properties
24+ // `props` 引数はコンポーネントに渡される生の値で、
25+ // 型やデフォルトの強制より前のものです。
26+ // また、 `inject` を使用して注入されたプロパティにアクセスすることもできます。
2727 return inject (' theme' , ' default-theme' )
2828 }
2929 }
You can’t perform that action at this time.
0 commit comments