mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-03-07 22:49:31 -07:00
documentation structure
This commit is contained in:
18
src/composables/useForceRerender.ts
Normal file
18
src/composables/useForceRerender.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
/**
|
||||
* Composable for force re-rendering components
|
||||
* Useful for demo components that need to restart animations or reset state
|
||||
*/
|
||||
export function useForceRerender() {
|
||||
const rerenderKey = ref(0)
|
||||
|
||||
const forceRerender = () => {
|
||||
rerenderKey.value++
|
||||
}
|
||||
|
||||
return {
|
||||
rerenderKey,
|
||||
forceRerender
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user