-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error kebabcase event name #20
Comments
I can't reproduce this. |
repo: https://github.com/QingWei-Li/vue-jsx-bug var Compo = {
render(h) {
return <button on-click={ () => this.$emit('handle-event') }>click me</button>
}
}
export default {
components: { Compo },
data () {
return {
msg: 'Hello Vue!'
}
},
render(h) {
return (
<div id="app">
<h1>{ this.msg }</h1>
<Compo on-handle-event={ () => console.log(12) }></Compo>
</div>
)
}
} console App.js Unexpected token (41:18)
You may need an appropriate loader to handle this file type.
| {
| on: {
| handle-event: function handleEvent() {
| return console.log(12);
| }
@ ./src/main.js 2:0-24
@ multi main |
|
but, it's work var Compo = {
render(h) {
return <button on-click={ () => this.$emit('handleevent') }>click me</button>
}
}
export default {
components: { Compo },
data () {
return {
msg: 'Hello Vue!'
}
},
render(h) {
return (
<div id="app">
<h1>{ this.msg }</h1>
<Compo on-handleevent={ () => console.log(12) }></Compo>
</div>
)
}
} |
Oops 😅, I just tested on a wrong component, just use camel case instead |
ohh,I also encountered this problem, thank you for your answer |
For someone who want to listen some non-native events of component, maybe it comes from 3rd party library: you have to use
|
console
The text was updated successfully, but these errors were encountered: