vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.33k forks source link

CustomElement props are not passed to setup function when using SFC with composition Api #6703

Open Xeon2003 opened 3 years ago

Xeon2003 commented 3 years ago

Version

5.0.0-beta.4

Environment info

WSL - Ubuntu 20.04

Steps to reproduce

I followed the guide with a fresh project. https://v3.vuejs.org/guide/web-components.html#tips-for-a-vue-custom-elements-library

As build target I used lib.

What is expected?

Props from a custom Element should be available in the setup function.

What is actually happening?

If the custom elements are used, the attributes are not correctly passed to the setup function of the SFC. Also in the onMounted hook they are not updated. In the template they are present.


The Same code compiled with vite behaves as expected.

screetBloom commented 3 years ago

can you provide a reproduction