https://github.com/supercll/vue-reactive
a simple data response for vue
https://github.com/supercll/vue-reactive
Last synced: 2 months ago
JSON representation
a simple data response for vue
- Host: GitHub
- URL: https://github.com/supercll/vue-reactive
- Owner: supercll
- Created: 2020-10-02T08:38:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-18T09:28:09.000Z (over 4 years ago)
- Last Synced: 2025-02-07T18:51:32.951Z (4 months ago)
- Language: HTML
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tasking
1. 创建数据
2. 插入的页面的功能,需要保存起来(watcher)
3. 把数据定义为响应式的(defineReactive)
1. 把每一个属性都通过defineProperty定义
4. 发布事件2. 设置一个active全局变量,事件执行之前将watcher存入active
3. 每个属性中都需要设置一个收集器dep
4. 获取数据时通过判断active收集active中存放的watcher事件
5. 如果触发数据更新set,就将对应属性中dep中的watchers依次触发
6. 首次执行完成事件后,将active清除,方便下一次收集事件# to be continued