Vue: v-model not working inside scoped slots

Created on 17 Mar 2019  路  1Comment  路  Source: vuejs/vue

Version

2.6.8

Reproduction link

https://codepen.io/bassta/pen/vPrYdY

Steps to reproduce

  1. Create new component, add slot to it, bind some data to the slot
  2. Create new instance of the component, add input inside slot, bind v-model to it.

What is expected?

Component data, bind to v-model to change

What is actually happening?

Nothing, doesn't throw error


Showing data works, binding v-model to data does not.

Most helpful comment

you are not supposed to modify the data you pass to a slot, pretty much like a prop.
You should pass a method instead to change tha value. You can always pass an object and modify a property (like a prop) but it's also not recommended

>All comments

you are not supposed to modify the data you pass to a slot, pretty much like a prop.
You should pass a method instead to change tha value. You can always pass an object and modify a property (like a prop) but it's also not recommended

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bfis picture bfis  路  3Comments

franciscolourenco picture franciscolourenco  路  3Comments

wufeng87 picture wufeng87  路  3Comments

hiendv picture hiendv  路  3Comments

loki0609 picture loki0609  路  3Comments