Subscribe on changes!

v-bind没有响应式

avatar
Jul 4th 2022

Vue version

vue3

Link to minimal reproduction

https://sfc.vuejs.org/#eNptUl1OwzAMvooVIQ3E1mxIvJRugnvkYV2XtdnWJErcbWjqBTgEQjzwyAGQOM7ugfs3yo8fWtv5/Nn+kiN7sDbYFZKFLEKZ222MciY0kEWLAtFouE+2KtlMBUPpUbDZ6fX59PRyev88fbxFvAF1JUu1g9Dj41YSPjF6pdKgDqmugdSwbDKbRJy+bRmnunNXx/tsu9FC6eWZ7Q/PzT88Ee+tQqFPnLIIXmJhW6jKrXEIR3AyTlDtJJSwciaHAYkxuKvKKthWIuzVEjOYwmQ8pnyXbcahdEdwefwerF45hF6mspoohPnFsfZKe5gPfyIyqdIMQxhQL3sY/DpdxMkmdabQS0IYF+tU9iFl65dXvTGrO6MhL69gOuvP0yx1PYXbbqnK+jcWdHv3522xJf0j3shKgrIha/Qc5bEN1t5oek51M9EeeMHOcghGElexYBmi9SHnfpVUj3DtA+NSTl7gCo0ql4H0+WjhzN5LR8SCVRSl0CUrvwCIANlh

Steps to reproduce

What is expected?

有响应式

What is actually happening?

无响应式

System Info

No response

Any additional comments?

No response

avatar
Jul 4th 2022

It may be that the direct v-bind deconstructs the config, resulting in the failure of the response.

avatar
Jul 4th 2022

image 只要加一点其他属性,就有了....不知道为啥

avatar
Jul 4th 2022

分析了一下

export function guardReactiveProps(props: (Data & VNodeProps) | null) {
  if (!props) return null
  return isProxy(props) || InternalObjectKey in props
    ? extend({}, props)
    : props
}

似乎是这里的浅拷贝导致当你修改witdh,dynamicChildren中的旧props也改变了,这样在patchProps时就没有重新渲染 It seems that the shallow copy here causes the old props in dynamicchildren to change when you modify the width, so there is no re rendering when patchprops