vuejs / babel-plugin-transform-vue-jsx

babel plugin for vue 2.0 jsx
1.85k stars 132 forks source link

How to register capture event in jsx #170

Closed autumnLeaves0 closed 5 years ago

autumnLeaves0 commented 5 years ago

use template <div @click.capture="handle"></div>

use createElement createElement('div', { on:{ '!click: handle } })

How to use JSX?

autumnLeaves0 commented 5 years ago

can use Object Spread (...{}) avoid compiling by JSX, for Example <div {...{ is: 'p }}/> <div {...{ on: { click: handle } }}/>

autumnLeaves0 commented 5 years ago

Can you provide more JSX grammar support?

nickmessing commented 5 years ago

You can either do <div {...{ on: '!click': handle }} /> or you can try the new JSX implementation that supports event modifiers like <div vOn:click_capture={handle} /> https://github.com/vuejs/jsx