Comments (6)
a.b.$raw === b // true
使用 $raw
访问到真实对象引用,否则是代理。
from dob.
比较奇怪的是 B类并未被监听,为何返回的b对象会是代理呢。
from dob.
@FishOrBear 因为 A 类是 observable
的,a.setB(b)
就会将 a 中的 b 变成 observable
。
A 类只要是被 observable
装饰,所有内部数据都是被监听的。
from dob.
@ascoders
还有一个问题, 这样会导致 a instanceof A
失效
from dob.
确实,因为 a 是一个 proxy,不过数据流场景应该使用不到吧。
请问有 a instanceof A
这种场景吗?
from dob.
@ascoders 对我来说 会有这个情况 可能使用场景的问题吧..
from dob.
Related Issues (10)
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 dob.