Closed DrMabuse23 closed 3 years ago
@DrMabuse23 That warning is expected. Vue performs a type check on the incoming props. In the demo component, prop type is defined as Number @ https://github.com/sreenaths/vue3-webcomponent-wrapper-demo/blob/main/src/components/Counter.vue#L12
For simplicity of the demo, we are passing the prop directly as HTML attribute @ https://github.com/sreenaths/vue3-webcomponent-wrapper-demo/blob/main/public/index.html#L11 On passing as HTML attributes, value is converted to string before passing into the component. Hence the above warning.
To avoid the warning, you can pass the prop as number using javascript. Same can be used for object or any other data type.
document.getElementsByTagName("demo-counter")[0].value = 3;
Hello i try this demo and i get
this warning, did you know why this is happens ? why it couldnt be a number ?
but my real question is i cant see a shadow-dom you have any plans to add this and changing the build process to apply the styles ?
thx in advance