Comments (4)
As noted in the following comments, the current behavior is expected: vuejs/core#1209 (comment)
from vue.
@posva OP also opened this issue in the core repo, and there I noted that there is one weird thing: watch(aShallowRef, ...) does trigger the watch. Normal refers, or getter functions, don't. So only when you watch a shallowRef directly, it will be triggered.
This seeems to be by design, but I question the wisdom of that design. See vuejs/core#9579 (comment)
Should we consider re-opening this issue here until we settled the raised question over in core?
from vue.
Hi, sorry for the duplication, I got confused and opened two issues.
I'd appreciate at least there would be some documentation regarding this. I've updated my application to use watch(aShallowRef to get this working for now.
A trivia: All of the major language models I asked for help including GPT 4.0 is confused about this behavior and expects watch(() => aShallowRef.value) to be triggered, not only humans 🙂
from vue.
I think having one is core is enough but I think current behavior makes more sense: when you pass a getter, if the returned value do not change, the watcher shouldn’t trigger
from vue.
Related Issues (20)
- Component caching - wrong type returned in a `set` method HOT 1
- Dynamic component not rendering slot tree HOT 1
- Urgent: Black Duck Vulnerability Fix Needed for 'vue-template-compiler' HOT 1
- Why does manipulating the style property of the DOM not take effect? HOT 1
- Memory leak when using functional components in Vue 2.7.14 HOT 6
- test
- [Feature Request] Be able to skip hydration HOT 1
- Cannot load extension with file or directory name _plugin-vue_export-helper.js. Filenames starting with "_" are reserved for use by the system. HOT 1
- Bug: Controlled components can lead to an inconsistent state between Vue and DOM HOT 3
- v-if and v-else on same element has inconsistent (or undocumented) behaviour HOT 1
- Vue-specific attributes are invalid html HOT 1
- Custom error handler causing recursive error handling leading to Maximum call stack size exceeded error HOT 2
- Custom equality for watch HOT 9
- 自定义事件冒泡问题
- replace lodash with es-toolkit in vue-server-renderer for modern utility and safer maintenance HOT 1
- improve the warning in `inject` HOT 1
- Developer Tools Integration: JSON Formatter for Vue.js Developers HOT 1
- [High] Memory Leak in vue HOT 1
- [Medium] Race Condition in vue HOT 2
- Closed by author
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
OpenClaw
Personal AI Assistant
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue.