@@ -93,7 +93,7 @@ Creates virtual DOM nodes (vnodes).
93
93
})
94
94
```
95
95
96
- - See also: [ Guide - Creating VNodes] ( /guide/extras/render-function.html#creating-vnodes )
96
+ - ** See also:** [ Guide - Creating VNodes] ( /guide/extras/render-function.html#creating-vnodes )
97
97
98
98
## mergeProps()
99
99
@@ -278,12 +278,16 @@ For adding custom directives to vnodes.
278
278
- ** Example**
279
279
280
280
```js
281
- import { h , withDirectives } from Vue
281
+ import { h , withDirectives } from ' vue '
282
282
283
283
// a custom directive
284
284
const pin = {
285
- mounted() { /* ... */ },
286
- updated() { /* ... */ }
285
+ mounted() {
286
+ /* ... */
287
+ },
288
+ updated() {
289
+ /* ... */
290
+ }
287
291
}
288
292
289
293
// <div v-pin:top.animate="200"></div>
@@ -293,3 +297,28 @@ For adding custom directives to vnodes.
293
297
` ` `
294
298
295
299
- **See also:** [Guide - Render Functions - Custom Directives](/guide/extras/render-function.html#custom-directives)
300
+
301
+ ## withModifiers()
302
+
303
+ For adding built-in [ ` v - on ` modifiers](/guide/essentials/event-handling.html#event-modifiers) to an event handler function.
304
+
305
+ - **Type**
306
+
307
+ ` ` ` ts
308
+ function withModifiers(fn : Function , modifiers : string []): Function
309
+ ```
310
+
311
+ - ** Example**
312
+
313
+ ```js
314
+ import { h , withModifiers } from ' vue'
315
+
316
+ const vnode = h (' button' , {
317
+ // equivalent of v-on.stop.prevent
318
+ onClick: withModifiers (() => {
319
+ // ...
320
+ }, [' stop' , ' prevent' ])
321
+ })
322
+ ` ` `
323
+
324
+ - **See also:** [Guide - Render Functions - Event Modifiers](/guide/extras/render-function.html#event-modifiers)
0 commit comments