Skip to content

Commit 3cd3134

Browse files
committed
✨feat: 完善 5.8.6 values与keys方法
1 parent a4cab70 commit 3cd3134

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

第5章非原始值的响应式方案/5.8_代理Set和Map/5.8_代理Set和Map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ const p = reactive(new Map([
546546
['key2', 'value2'],
547547
]));
548548
effect(() => {
549-
for (const value of p) {
549+
for (const value of p.keys()) {
550550
console.log('触发了values拦截', value);
551551
}
552552
});

第5章非原始值的响应式方案/5.8_代理Set和Map/5.8_代理Set和Map.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ const p = reactive(new Map([
635635
]))
636636

637637
effect(() => {
638-
for (const value of p) {
638+
for (const value of p.keys()) {
639639
console.log('触发了values拦截', value);
640640
}
641641
})

0 commit comments

Comments
 (0)