Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 98e77ae

Browse files
authored
docs: add addendum on useId usage with computed (#2604)
1 parent 063f499 commit 98e77ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/api/composition-api-helpers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ TypeScript を使用する場合は、代わりに [`defineSlots()`](/api/sfc-sc
132132
`useId()` で生成された ID は、サーバとクライアントのレンダー間で安定していることが保証されているため、SSR アプリケーションでもハイドレーションミスマッチを起こすことなく使用できます。
133133

134134
同じページ内に複数の Vue アプリケーションのインスタンスがある場合、[`app.config.idPrefix`](/api/application#app-config-idprefix)を使用して各アプリケーションに ID プレフィックスを与えることで、ID の衝突を避けることができます。
135+
136+
:::warning 注意
137+
`useId()``computed()` プロパティ内で呼び出すべきではありません。インスタンスの競合を引き起こす可能性があります。代わりに、`computed()` の外で ID を宣言し、computed 関数内でその ID を参照してください。
138+
:::

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /