File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ const sidebar = {
195
195
'/guide/migration/keycode-modifiers' ,
196
196
'/guide/migration/listeners-removed' ,
197
197
'/guide/migration/mount-changes' ,
198
- // '/guide/migration/props-data',
198
+ '/guide/migration/props-data' ,
199
199
'/guide/migration/props-default-this' ,
200
200
'/guide/migration/render-function-api' ,
201
201
'/guide/migration/slots-unification' ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ badges :
3
+ - removed
4
+ ---
5
+
6
+ # ` propsData ` <MigrationBadges :badges =" $frontmatter.badges " />
7
+
8
+ ## 概要
9
+
10
+ Vue インスタンスの生成時に props を渡すために使われていた ` propsData ` オプションは削除されました。Vue 3 アプリケーションのルートコンポーネントに props を渡すには、 [ createApp] ( /api/global-api.html#createapp ) の第2引数を使います。
11
+
12
+ ## 2.x での構文
13
+
14
+ 2.x では、 Vue インスタンスの生成時に props を渡すことができました:
15
+
16
+ ``` js
17
+ const Comp = Vue .extend ({
18
+ props: [' username' ],
19
+ template: ' <div>{{ username }}</div>'
20
+ })
21
+
22
+ new Comp ({
23
+ propsData: {
24
+ username: ' Evan'
25
+ }
26
+ })
27
+ ```
28
+
29
+ ## 3.x での更新
30
+
31
+ ` propsData ` オプションは削除されました。生成時にルートコンポーネントのインスタンスに props を渡す必要がある場合は、 ` createApp ` の第2引数を使ってください:
32
+
33
+ ``` js
34
+ const app = createApp (
35
+ {
36
+ props: [' username' ],
37
+ template: ' <div>{{ username }}</div>'
38
+ },
39
+ { username: ' Evan' }
40
+ )
41
+ ```
You can’t perform that action at this time.
0 commit comments