Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit f076639

Browse files
committed
perf: should optimize call frequency during list operations
1 parent 0ee029d commit f076639

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/runtime-vapor/__tests__/for.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,20 +436,20 @@ describe('createFor', () => {
436436
'<li>0. 1</li><li>1. 2</li><li>2. 3</li><li>3. 4</li><!--for-->',
437437
)
438438

439-
// change
439+
// change deep value should not update
440440
list.value[0].name = 'a'
441441
setList()
442442
await nextTick()
443443
expect(host.innerHTML).toBe(
444-
'<li>0. a</li><li>1. 2</li><li>2. 3</li><li>3. 4</li><!--for-->',
444+
'<li>0. 1</li><li>1. 2</li><li>2. 3</li><li>3. 4</li><!--for-->',
445445
)
446446

447447
// remove
448448
list.value.splice(1, 1)
449449
setList()
450450
await nextTick()
451451
expect(host.innerHTML).toBe(
452-
'<li>0. a</li><li>1. 3</li><li>2. 4</li><!--for-->',
452+
'<li>0. 1</li><li>1. 3</li><li>2. 4</li><!--for-->',
453453
)
454454

455455
// clear

packages/runtime-vapor/src/apiCreateFor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
effectScope,
55
isReactive,
66
shallowRef,
7-
triggerRef,
87
} from '@vue/reactivity'
98
import { isArray, isObject, isString } from '@vue/shared'
109
import {

0 commit comments

Comments
 (0)