tsx Functional components use a life cycle
const temp= () => {
const updateTime = (date: Date) => dateTransform(date, 'YYYY-MM-DD hh:mm:ss')
const time = ref(updateTime(new Date()))
let timer: any = null
timer = setInterval(() => {
time.value = updateTime(new Date())
}, 1000)
onUnmounted(() => {
clearInterval(timer)
})
return (
<>
<div class={Header.time}>{time.value}</div>
</>
)
}
Hello, thank you for taking time filling this issue!
However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).
I hope to see your helper-created issue very soon!