Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref()响应值在更新后,devtools没有刷新数据,手动刷新后数值正确显示 #2045

Open
dfjfj opened this issue Apr 6, 2023 · 5 comments

Comments

@dfjfj
Copy link

dfjfj commented Apr 6, 2023

Vue devtools version

6.5.0

Link to minimal reproduction

https://play.vuejs.org/#eNqVVk9v3EQU/yqDD7VXSryhcFp2IyqhSkggOHDDHLzrcdbUO7bs8ZLVaiWkkJKUFEU0HABRZaWGhgNL4JBC0/TTxPvnxFfgzYxnPM6mdJHyx/P8m3nv/d6b3/PQuBPHdj/DRsNoUtyLQ5fiTYcg1PSCPuqEbpq2HINGXrTeiQh1A4ITx+CImzBfJG6sXgPgEzC+T+KMokZAUpzQdQYDtFix145Rr+I/CFKAM5w8NnUM1Oi6xAvxexHBYC0XS9vvRhHFiTQ26xCjSKh4ata1PGGZdpIgpvAc9OIooWiYYH+E/CTqIROIMdWLMhf+0jHsujIxCh3jnQqW51GBMstNSBFy4VNAhYmBTcA6BG9ztId9NwshSJYRcXu4AYdDCR1jjVk6ERxKMKFpQ0CQdj5HCAOPWVuzwNhqxG0pplls1eQJUHdIhNcBtRCwY30qCR8GXgOZGxtvmmsMRsEzrPPDncXJb2DyIJYG8t0wxeJkfc/typ7Zz+P50321hybZDVveqmyZ7j+a/3Effq55Ers+q3He2KOfkQ4NIoLKprNYOipDkWMUYjuMtiwT+JxdfHV1cZ4/+3P67cn06DzfO5t+fzZ9ODFrcgfnw+67YYbtjKTdwKfiUHDL3kMY17yXPWsFnubbjxJkhVhQjCJfP1qDIRT4iLuwAw+1Wi1UOUXGZDMqoE5vqIWO0PPU3eiYBMqfFMEXmVQeVGYCWIbAD1RFK8lWJu3WypP4H/hp1tU9NNYM/bIsK1MWVkWnB6pUahLvb9iA+uvAbIGBaER4TEnu4UFhBiaZodAk9m8FpWnWs/CVOiIuT6kmKhr9cjNDebXhToOqfpxEcWpxLnmgDXQnSdwB566MQV1rOohhcbfoLckj1FERWdAofS3TGAaSstBtY5ZSoaIBFznmAfLvdHHnXjvaZsTwZ+xJ8nhzGejdDsS3VeVK9mmtIs9p7JLN4VD0aXGR0WgEIbMXUrD1aJrtjFK4O7LebUoQ/K57zCMMIpTSQchce0EKqQ0ahMe0me8dL3540qyL7UXZeMKvKVs5BiLyYZRBiF4xDBxDKvcrSnatNh+1P8cdTVX/TxEdUq8jFYAFWtzarGqUcAjKF7MgbK48N1VfDqcV5nsXu54+3CttQPE2Bbphfwd3oxCAYJz//mz+8lG+e3J1eTz7ERTzIn8wzg8fzp6e/fPiYHqwn//0eH75y+JoMhtP5pMnrFng8mWxDYXnJ7iep38D/PeM1ooE9Mg6EZdEQVkksSzqJEYXpwgkcalqpUStUhIl5EXQFu5DGoUEM/2WHd1C/I1N3WQLA/tMYflUYAIuQbdulc8tudWmSdCzajWl65Dn/GxndnQ62zsXM+nqxfHiy++A7fzrS5hJLDcBFY2gjTily4wsGKCCGatWKrSYqm+bylKEodbaWC0Um0+KEcJgkTG6IXi0TNUM+cvd/MHjq+ffLMZ/m2IccqGHMKZ/7c5+fS5g0/F9Zl2mCugw4atLHwpFN5cfRSu0s8/BZTuvJnLld2NFhjSB0rUMPhDyycF073Cj0DBUR/nu6WLn9HYJrsrbawRtEygC5VIHizt1TchWvCQlfaN/ATiHNVQ=

Steps to reproduce & screenshots

勾选第一个,然后打开开发者工具,观察app组件中数组第一个对象的done属性。

What is expected?

期待开发者工具中的app组件中数组第一个对象的done属性值实时更新。我看视频的时候,视频里教的是v2版本,但是对应的当时的开发者工具是可以实时更新的。

What is actually happening?

没变化,要点击开发者工具中的强制刷新按钮才更新。我还把更新后的数组打印出来了,确定程序无误。

System Info

System:
    CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
    Memory: 6.15 GB / 15.92 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (111.0.1661.62)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.45 => 3.2.45

Any additional comments?

不管能否修复,请给个回复,帮帮我这可怜的初学者吧。

@lq9958
Copy link

lq9958 commented Apr 8, 2023

我这边也是,组件数据都更新了,但是devtool数据一直不更新,必须刷新才能正常显示

@Azurewarth0920
Copy link
Contributor

@dfjfj @lq9958

Playground 里面的写法实际上是在子组件里隐式更改了父组件的状态。
在这种情况下父组件的 updated 方法并没有被触发所以也就不能正确地更新父组件在 devtool 里面的状态。

@dfjfj
Copy link
Author

dfjfj commented May 4, 2023

@Azurewarth0920
只能通过事件的方式来更改父组件才可以,对吗?

@Azurewarth0920
Copy link
Contributor

@dfjfj

推荐是这样的。

但是我觉得现在 devtool 的实现不够准确,我会写一个 PR 修正这个问题。

@Azurewarth0920
Copy link
Contributor

Related: #2064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants