Skip to content

Commit b962aa5

Browse files
sxzzLittleSound
andcommitted
refactor(runtime-vapor): remove support of shallowRef in v-for
Co-authored-by: Rizumu Ayaka <[email protected]>
1 parent c366948 commit b962aa5

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ describe('createFor', () => {
383383
expect(host.innerHTML).toBe('<!--for-->')
384384
})
385385

386-
test('shallowRef source', async () => {
386+
test.fails('shallowRef source', async () => {
387387
const list = shallowRef([{ name: '1' }, { name: '2' }, { name: '3' }])
388388
const setList = (update = list.value.slice()) => (list.value = update)
389389
function reverse() {

packages/runtime-vapor/src/apiCreateFor.ts

-5
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,9 @@ function updateState(
347347
newIndex: number | undefined,
348348
) {
349349
const [item, key, index] = block.state
350-
const oldItem = item.value
351350
item.value = newItem
352351
key.value = newKey
353352
index.value = newIndex
354-
355-
if (oldItem === newItem && !isReactive(oldItem)) {
356-
triggerRef(item)
357-
}
358353
}
359354

360355
export function createForSlots(

0 commit comments

Comments
 (0)