Subscribe on changes!

Props named after 'onXXX' are considered as event handler and skipped by mergeProps

avatar
Apr 28th 2023

Vue version

3.2.47

Link to minimal reproduction

SFC Playground

Steps to reproduce

  1. Comp define prop onProgressNum in type number
  2. create vnode of Comp with props {onProgressNum: 0}
  3. clone vnode with extra props {onProgressNum: 0}, name it as cloned0
  4. clone vnode with extra props {onProgressNum: 1}, name it as cloned1
  5. prop onProgressNum in cloned0 was skipped and got undefined

What is expected?

Do not skip props name after 'onXXX' or print warning to indicate the problem.

What is actually happening?

prop onProgressNum in cloned0 was skipped and got undefined

System Info

System:
    OS: macOS 13.3.1
    CPU: (8) x64 Apple M2
    Memory: 30.43 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v14.20.0/bin/yarn
    npm: 6.14.18 - ~/.nvm/versions/node/v14.20.0/bin/npm
  Browsers:
    Safari: 16.4
  npmPackages:
    vue: ^3.2.47 => 3.2.47

Any additional comments?

The issue was probably introduced by this commit which release in 3.2.28