Skip to content

in custom-element components not correct handling type #4370

@catsmeatman

Description

@catsmeatman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.🐞 bugSomething isn't workingscope: custom elements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions