Skip to content

v-model in child components #1159

@kjugi

Description

@kjugi

Version

3.0.0-beta.10

Reproduction link

https://jsfiddle.net/kjugi/ftz7xyo2/

Steps to reproduce

  1. Have child component with v-bind="$attrs"
  2. Initialize it in parent component with v-model="someField"
  3. Type inside input text
  4. Should update input value itself and print value in the variable on parent component
  5. Click button to clear value from input and parent component variable

Also, I saw an RFC for this update and not sure is it working in a new way

What is expected?

v-model updates on both sides and we don't need to emit any value or trigger value by additional props

I've achieved it here but I think that's not how it should look like

What is actually happening?

Without manual emit update passed we are not able to fill the input. In the second step when we want to clear input we need to pass new value prop which updates the input value


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