Skip to content

Commit 84b006b

Browse files
committed
docs: withModifiers
1 parent b817fa3 commit 84b006b

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

packages/babel-plugin-jsx/README-zh_CN.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ const App = defineComponent(() => {
7171
});
7272
```
7373

74+
```jsx
75+
import { withModifiers } from 'vue';
76+
77+
const App = () => {
78+
const count = ref(0);
79+
80+
const inc = () => {
81+
count.value++;
82+
};
83+
84+
return () => (
85+
<div onClick={withModifiers(inc, ['self'])}>
86+
{count.value}
87+
</div>
88+
);
89+
}
90+
```
91+
7492
Fragment
7593

7694
```jsx
@@ -164,8 +182,8 @@ const App = {
164182
const App = {
165183
setup() {
166184
const slots = {
167-
a: () => <div>A</div>,
168-
b: () => <span>B</span>
185+
default: () => <div>A</div>,
186+
foo: () => <span>B</span>
169187
};
170188
return () => <A v-slots={slots} />;
171189
}

packages/babel-plugin-jsx/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@ const App = defineComponent(() => {
7070
});
7171
```
7272

73+
```jsx
74+
import { withModifiers } from 'vue';
75+
76+
const App = () => {
77+
const count = ref(0);
78+
79+
const inc = () => {
80+
count.value++;
81+
};
82+
83+
return () => (
84+
<div onClick={withModifiers(inc, ['self'])}>
85+
{count.value}
86+
</div>
87+
);
88+
}
89+
```
90+
7391
Fragment
7492

7593
```jsx
@@ -163,8 +181,8 @@ const App = {
163181
const App = {
164182
setup() {
165183
const slots = {
166-
a: () => <div>A</div>,
167-
b: () => <span>B</span>
184+
default: () => <div>A</div>,
185+
foo: () => <span>B</span>
168186
};
169187
return () => <A v-slots={slots} />;
170188
}

0 commit comments

Comments
 (0)