Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

v-model can only be used on <input>, <textarea> and <select> elements. #456

Open
@codebykyle

Description

@codebykyle

Version

5.0.0

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Use v-model on any component-based field

What is expected?

VueJS allows you to use v-model on any element which implements the :value data binding and emits the @input event.

You can find this in the official documentation for custom components here:
https://vuejs.org/v2/guide/forms.html

And here:

https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components

The current implementation does not allow for this

What is actually happening?

The resulting behavior is that any component which implements the above pattern results in an error which cannot be built


I believe there should not be a check on v-model on components. Any element can support v-model provided it accepts a value and emits an event, per the Vue2 documentation. It is possible there is something I am missing here, if so, any advice would be appreciated.

Thank you

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