Hook Utama
onMounted(() => {
console.log("Komponen dimuat!")
})
onUnmounted(() => {
console.log("Komponen dihapus!")
})
---template---
<p>Cek console!</p>
Urutan Lifecycle
setup()— InisialisasionBeforeMount— Sebelum render pertamaonMounted— Setelah render pertama (DOM ready)onBeforeUpdate— Sebelum re-renderonUpdated— Setelah re-renderonBeforeUnmount— Sebelum dihapusonUnmounted— Setelah dihapus