Props not available in life-cycle hooks in custom elements
Version
3.2.19
Reproduction link
Steps to reproduce
General
- Create a custom element
- Try using the life-cycle hooks to access the props.
Reproduction through the example
- Clone the repo provided
- Run
npm i --save
- Run
npm run build:wc
- Copy the output into lab directory
cd lab
then runnpx http-server
What is expected?
Expected props to be available in created/mounted/before mount hooks.
What is actually happening?
Props are undefined in setup/onMounted/onBeforeMount or created hooks
This is happening in the defineCustomElement
API.
Also, it says the attributes have not been passed in console warning, even though the attributes have been passed in.
I believe I'm seeing the same problem: https://github.com/vuejs/vue-next/issues/4789