Skip to content

A component is mounted using render(), and when the parent component's value changes, the child component does not change. #7396

Discussion options

You must be logged in to vote

The children component is not update is because when use the textObj.a, it is a string not a ref.

The textObj.a is a string because when get value will return the res.value As the following source code shows.

if (isRef(res)) {
// ref unwrapping - skip unwrap for Array + integer key.
return targetIsArray && isIntegerKey(key) ? res : res.value
}

You can use like this:

playground

App.vue

<script setup>
import { ref, h, render as r, reactive, watch } from 'vue'
import HelloWorld from "./HelloWorld.vue"
  const text = ref("1")
  const textObj = reactive({
    a:text
  })
  
  console.warn(t…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@Jinzm
Comment options

@Jinzm
Comment options

@liulinboyi
Comment options

@Jinzm
Comment options

@liulinboyi
Comment options

Answer selected by Jinzm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants