Subscribe on changes!

Wrong trigger handler when emits is a string

avatar
May 26th 2023

Vue version

latest

Link to minimal reproduction

https://play.vuejs.org/#eNpdUD1LxEAQ/SvDImwCR4LtkQTF0r+QJmTnuIV8LNlNUEIasbGy0kK0EbG29A/lxH9xs9lLuLtm2ffezJs307NrpYKuRbZmkc4bqQxoNK1K0kqWqm4M9NDgBgbYNHUJnEr5It3UpTrwQWiBdSI5ryttbFumBcT243Huz/w2qyzrCR/i5FAVdFnRIrEiraLQBaEIBAyWqsgMEgLoe1c+DKRM0680FpgbWVe3eK/jlFn3lCXRlIeaonBxYCs2h7TrHjlHQnbTgJx02+PwUS+BJRUA3k37CwrTFnQiyxFbSqPXwE8i8ZUT8wbJR3j+XB2GMP5+796f/j8/xq/Xv7fH8flh9/LjVLOVOriwjt65H1zSKQHoBNOznIsNe5XKpPU=

Steps to reproduce

open the link

What is expected?

According to the documentation, it is a wrong usage when emits is a string, then the related handler should not be triggered https://cn.vuejs.org/api/options-state.html#emits selectionKeys should not be triggered

What is actually happening?

Wrong trigger handler when emits is a string

System Info

No response

Any additional comments?

related: #8413

avatar
May 26th 2023

Declaring the emits only removes it from attrs. Non-declared events can still be triggered. This is expected behavior.