in vue 3.0.4, emit in setup function cant effect
Version
3.0.4
Reproduction link
https://codesandbox.io/s/festive-wing-q226i?file=/src/components/HelloWorld.vue
Steps to reproduce
- declare an emit in child component like
setup(props,{emit}){
emit('set-value',456)
}
- in parent component, declare a handler
What is expected?
trigger the handler
What is actually happening?
handler cant be triggered
in 3.0.0, the handler can be triggered
@shlroland Maybe this is a bug of codesandbox, if you create an project with vue-cli, then it will trigger the handler. I have met this issue ever before.
@shlroland Maybe this is a bug of codesandbox, if you create an project with vue-cli, then it will trigger the handler. I have met this issue ever before.
but in my loccal project(dont use vue cli), this bug is exist
Could you try my project: https://github.com/Alanscut/vue-next-emit and even I introduced it with cnd package, it still work well: https://github.com/Alanscut/vue-next-emit/blob/master/html/index.html
in the console, your will see '### handler has been triggered.'
Could you try my project: https://github.com/Alanscut/vue-next-emit and even I introduced it with cnd package, it still work well: https://github.com/Alanscut/vue-next-emit/blob/master/html/index.html
in the console, your will see '### handler has been triggered.'
i am wirting a UI library rol-ui
for vue3 when i use vue3.0.0 ,the rol-time-picker works,but in 3.0.4,it meets an error. Through vue-devtool, i can collect children props by emit trigger in 3.0.4,but i can do it in 3.0.0.
Could you try my project: https://github.com/Alanscut/vue-next-emit and even I introduced it with cnd package, it still work well: https://github.com/Alanscut/vue-next-emit/blob/master/html/index.html in the console, your will see '### handler has been triggered.'
i am wirting a UI library
rol-ui
for vue3 when i use vue3.0.0 ,the rol-time-picker works,but in 3.0.4,it meets an error. Through vue-devtool, i can collect children props by emit trigger in 3.0.4,but i can do it in 3.0.0.
Hey.
Looking at package.json, @vue/compiler-sfc is not updated to 3.0.4.
Could you try my project: https://github.com/Alanscut/vue-next-emit and even I introduced it with cnd package, it still work well: https://github.com/Alanscut/vue-next-emit/blob/master/html/index.html in the console, your will see '### handler has been triggered.'
i am wirting a UI library
rol-ui
for vue3 when i use vue3.0.0 ,the rol-time-picker works,but in 3.0.4,it meets an error. Through vue-devtool, i can collect children props by emit trigger in 3.0.4,but i can do it in 3.0.0.Hey. Looking at package.json, @vue/compiler-sfc is not updated to 3.0.4.
it works. thx