in custom-element components not correct handling type
Version
3.2.4
Reproduction link
https://codepen.io/pawel-golubew/pen/OJmeLvV
Steps to reproduce
- Define component
const ShowPhoneNumber = Vue.defineCustomElement({
props: {
phone: String
},
template: `<div>Phone number is: {{phone}}</div>`,
});
customElements.define('show-phone-number', ShowPhoneNumber);
- Use component
<show-phone-number phone="8-909-952-45-93"></show-phone-number>
- Show in console
[Vue warn]: Invalid prop: type check failed for prop "phone". Expected String with value "8", got Number with value 8.
at <App phone=8 > warn$1 @ vue@next:8290
What is expected?
Show number 8-909-952-45-93 as string
What is actually happening?
Show only first char string
There are some bugs here:
https://github.com/vuejs/vue-next/blob/872b3f7ec5e1a41c60018bb1f64d841c309b8939/packages/runtime-dom/src/apiCustomElement.ts#L248-L250
Will convert attribute
to number
.