• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • withModifiers()

    用于向事件处理函数,添加内置v-on修饰符。

    类型

    function withModifiers(fn: Function, modifiers: string[]): Function
    


    例子

    import { h, withModifiers } from 'vue'
    
    const vnode = h('button', {
      // equivalent of v-on.stop.prevent
      onClick: withModifiers(() => {
        // ...
      }, ['stop', 'prevent'])
    })