New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom element 'Array/Object' props Bug #4382
Comments
similar to #4370 |
you are passing a string, so you get a string. the recommended best practice for custom elements seems to be to use DOM properties for passing object/arrays values. Which Vue already does. So this will work if used in a Vue app: <custom-select :options="['1', '2', '3']" value="1"/> Other frameworks may have other ways of setting a DOM property. And yes, in vanilla JS you would have to use JS to set that prop and can't use an attribute. |
Probably worth adding a note to docs at https://v3.vuejs.org/guide/web-components.html#definecustomelement. Could you open a PR or issue in the vuejs/docs repo? |
Version
3.2.4
Reproduction link
https://codesandbox.io/s/vue-3-2-custom-element-array-bug-sqpip
Steps to reproduce
What is expected?
Convert the value of the 'options' prop to an Array.
What is actually happening?
The prop type 'Array' is ignored.
The text was updated successfully, but these errors were encountered: