Skip to content

Passing an integer to a component throws warning because vue takes it as string #2168

@tristanbes

Description

@tristanbes

Using vue 1.0.14 when using a component like:

<quick-assign-primary-user users_count=0></ quick-assign-primary-user>

With a props definition

var QuickPrimarySelect = Vue.extend({
    template: '#quick-primary-user-template',
    props: {
        users_count: {
            type: Number,
            required: true
        }
    }, ...
})

Gives an error/warning :
[Vue warn]: Invalid prop: type check failed for users_count="0". Expected Number, got String.

Resulting in users_count variable to be undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions