Subscribe on changes!

in vue 3.0.4, emit in setup function cant effect

avatar
Dec 23rd 2020

Version

3.0.4

Reproduction link

https://codesandbox.io/s/festive-wing-q226i?file=/src/components/HelloWorld.vue

Steps to reproduce

  1. declare an emit in child component like
setup(props,{emit}){
      emit('set-value',456)
  }
  1. 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

avatar
Dec 23rd 2020

@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.

avatar
Dec 23rd 2020

@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

avatar
Dec 23rd 2020

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.'

avatar
Dec 23rd 2020

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.

avatar
Dec 23rd 2020

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.

avatar
Dec 23rd 2020

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