Skip to content

Commit 9c9bf35

Browse files
committed
chore: up readme
1 parent 32b8ee5 commit 9c9bf35

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,14 @@ export default <Comp foo={foo} />
4040
2. ✅ Use the `defineComponent` macro from [@vue-macros/jsx-macros](https://github.com/vue-macros/vue-macros/pull/794) to wrapping.
4141

4242
```tsx
43-
defineComponent(({ foo }) => {
44-
return <div>{ foo }<div>
43+
const Comp = defineComponent(({ foo }) => {
44+
return <>{foo}</>
4545
})
46-
```
4746

48-
```tsx
49-
function Comp({ foo }) {
50-
return <div>{foo}</div>
51-
}
5247
// Will be convert to:
53-
function Comp(_ctx0) {
54-
return <div>{_ctx0.foo}</div>
55-
}
48+
const Comp = defineComponent((_props) => {
49+
return <>{_props.foo}</>
50+
}, { props: ['foo'] })
5651

5752
const foo = ref('foo')
5853
export default <Comp foo={foo.value} />

0 commit comments

Comments
 (0)