]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-vapor): remove support of shallowRef in v-for
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 27 Sep 2024 17:42:45 +0000 (01:42 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Fri, 27 Sep 2024 17:42:45 +0000 (01:42 +0800)
Co-authored-by: Rizumu Ayaka <rizumu@ayaka.moe>
packages/runtime-vapor/__tests__/for.spec.ts
packages/runtime-vapor/src/apiCreateFor.ts

index 8cb9f1c0020343ac70f1ac8fb7126327c4af05a7..2b882f95bf0662142fd3f964678f4c6969329dda 100644 (file)
@@ -383,7 +383,7 @@ describe('createFor', () => {
     expect(host.innerHTML).toBe('<!--for-->')
   })
 
-  test('shallowRef source', async () => {
+  test.fails('shallowRef source', async () => {
     const list = shallowRef([{ name: '1' }, { name: '2' }, { name: '3' }])
     const setList = (update = list.value.slice()) => (list.value = update)
     function reverse() {
index b27c69ec5ce085692319afc1f7e37b97a84068b6..e0a945d1a0dea8e5e1db17ac65357ec1f0422290 100644 (file)
@@ -347,14 +347,9 @@ function updateState(
   newIndex: number | undefined,
 ) {
   const [item, key, index] = block.state
-  const oldItem = item.value
   item.value = newItem
   key.value = newKey
   index.value = newIndex
-
-  if (oldItem === newItem && !isReactive(oldItem)) {
-    triggerRef(item)
-  }
 }
 
 export function createForSlots(