An open API service indexing awesome lists of open source software.

https://github.com/zhangyuang/vue3-staticnodecache-error


https://github.com/zhangyuang/vue3-staticnodecache-error

Last synced: 4 months ago
JSON representation

Awesome Lists containing this project

README

          

```bash
$ yarn && yarn dev
```
root component will remove element in beforeUnmount will generate side effect
click `tohello` to open hello component and return back to root component, `foo` element will never be rerender because root component is static and be cached

```ts




will never be rerender after unmount when children list too large



  • 列表1

  • 列表2

  • 列表3

  • 列表4

  • 列表5

  • 列表6

  • 列表7

  • 列表8

  • 列表9

  • 列表10

  • 列表11

  • 列表12

  • 列表13

  • 列表14

  • 列表15

  • 列表16





toHello

import { onBeforeUnmount, onMounted } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const foo = () => {
router.push('/hello')
}
onMounted(() => {
console.log('mounted')
})
onBeforeUnmount(() => {
const box = document.querySelector('.foo')
box?.remove()
})

```