docs: withModifiers

This commit is contained in:
Amour1688 2020-07-22 09:53:16 +08:00
parent b817fa38af
commit 84b006bdd3
2 changed files with 40 additions and 4 deletions

View File

@ -71,6 +71,24 @@ const App = defineComponent(() => {
});
```
```jsx
import { withModifiers } from 'vue';
const App = () => {
const count = ref(0);
const inc = () => {
count.value++;
};
return () => (
<div onClick={withModifiers(inc, ['self'])}>
{count.value}
</div>
);
}
```
Fragment
```jsx
@ -164,8 +182,8 @@ const App = {
const App = {
setup() {
const slots = {
a: () => <div>A</div>,
b: () => <span>B</span>
default: () => <div>A</div>,
foo: () => <span>B</span>
};
return () => <A v-slots={slots} />;
}

View File

@ -70,6 +70,24 @@ const App = defineComponent(() => {
});
```
```jsx
import { withModifiers } from 'vue';
const App = () => {
const count = ref(0);
const inc = () => {
count.value++;
};
return () => (
<div onClick={withModifiers(inc, ['self'])}>
{count.value}
</div>
);
}
```
Fragment
```jsx
@ -163,8 +181,8 @@ const App = {
const App = {
setup() {
const slots = {
a: () => <div>A</div>,
b: () => <span>B</span>
default: () => <div>A</div>,
foo: () => <span>B</span>
};
return () => <A v-slots={slots} />;
}