Comments (2)
watch( () => props.propData, () => {})
props.propsData
is not ref.
from core.
https://github.com/vuejs/core/blob/main/packages/runtime-core/src/apiWatch.ts#L241-L281
if (isRef(source)) {
getter = () => source.value
forceTrigger = isShallow(source)
} else if (isReactive(source)) {
getter = () => reactiveGetter(source)
forceTrigger = true
} else if (isArray(source)) {
isMultiSource = true
forceTrigger = source.some(s => isReactive(s) || isShallow(s))
getter = () =>
source.map(s => {
if (isRef(s)) {
return s.value
} else if (isReactive(s)) {
return reactiveGetter(s)
} else if (isFunction(s)) {
return callWithErrorHandling(s, instance, ErrorCodes.WATCH_GETTER)
} else {
__DEV__ && warnInvalidSource(s)
}
})
} else if (isFunction(source)) {
if (cb) {
// getter with cb
getter = () =>
callWithErrorHandling(source, instance, ErrorCodes.WATCH_GETTER)
But I saw it will all convert to getter anyway, is there anything I missed?
from core.
Related Issues (20)
- Element Attribute is not deleted when you go to another page HOT 5
- In development mode, there may be an issue where shapeFlag cannot be read HOT 2
- Unable to clear html elements from dom nodes. HOT 5
- 3.3+ defineEmits syntax does not support TS enums HOT 1
- Using v-bind to bind the background url property in css does not work HOT 2
- defineCustomElement - no way to provide props declaration
- v-model.number not casting string to number HOT 6
- V-model casts wrong type HOT 2
- Maximum recursive updates exceeded in component in 3.4.27 HOT 9
- Unresolvable type reference or unsupported built-in utility type 以及热更新失败 HOT 1
- defineModel is triggering update event, even if its value didn't actually change HOT 4
- Failed to add a reactive to the instance object HOT 5
- Invalid prop: type check failed, Expected Object when using keyof on type intersection
- 属性穿透失败 HOT 7
- A value is not reactive when it is created by `toRef` with an plain object. HOT 3
- defineAsyncComponent意外报错 HOT 3
- significant increase in size of `@vue/server-renderer`
- defineModel push array doesnt trigger the value HOT 5
- KeepAlive: `activated`/`deactivated` hooks not always run for descendants HOT 2
- Regarding the use of ref HOT 2
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.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
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 core.