Subscribe on changes!

in custom-element components not correct handling type

avatar
Aug 17th 2021

Version

3.2.4

Reproduction link

https://codepen.io/pawel-golubew/pen/OJmeLvV

Steps to reproduce

  1. Define component
const ShowPhoneNumber = Vue.defineCustomElement({
    props: {
        phone: String
    },
    template: `<div>Phone number is: {{phone}}</div>`,
});

customElements.define('show-phone-number', ShowPhoneNumber);
  1. Use component
<show-phone-number phone="8-909-952-45-93"></show-phone-number>
  1. 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

avatar
Sep 7th 2021

Any update on this?