Skip to content

Commit 0ae5b64

Browse files
fix: introduce the wrapper object to the props default example (#492)
1 parent 93b501a commit 0ae5b64

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/guide/migration/props-default-this.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ import { inject } from 'vue'
1919

2020
export default {
2121
props: {
22-
theme: props => {
23-
// `props` is the raw values passed to the component,
24-
// before any type / default coercions
25-
// can also use `inject` to access injected properties
26-
return inject('theme', 'default-theme')
22+
theme: {
23+
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
27+
return inject('theme', 'default-theme')
28+
}
2729
}
2830
}
2931
}

0 commit comments

Comments
 (0)