Skip to content

Expected Number, got String. #1704

@mikebronner

Description

@mikebronner

The following causes an error (running Vue 1.0.4):

                    <calc additions="5" subtractions="3"></calc>
Vue.component('calc', {
    props: {
        additions: {
            type: Number,
            required: true
        },
        subtractions: {
            type: Number,
            required: true
        }
    },

    template: '{{ additions - subtractions }} '
});
[Vue warn]: Invalid prop: type check failed for additions="5". Expected Number, got String.
[Vue warn]: Invalid prop: type check failed for subtractions ="3". Expected Number, got String.

Is this something with the way I am passing properties, or is this a bug in the property-type auto-conversion (similar to past issues on the same topic)?

(The above is a simplified example.)

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