简体   繁体   中英

Update props value in child component in vue

parent.vue

<template>
...
<div>{{ meet}} </div>
...
</template>
...
props: ["meet"]

child.vue

<template>
...
<meet :meet="showMeet(e.id)" /> 
</template>
...
props: ['meet'],
...
methods: {
   showMeet(id) {
      this.meet == 'abc';
   }
}

How do i update the value of the props to be used in child component

You may need to re-render the child component again. As per my understanding so far, the same prop is present in both the child's and if you update it's value from one, then you want to update it in second too. Refer this

https://michaelnthiessen.com/force-re-render/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM