I am working on a project using vue JS and inertia JS, basically I wanna trigger this code ONCE when the page loads or reloads.
router.visit('/getrequest',{
method:'get'
})
but its triggering nonstop even if I wrap it with onMounted() still the same issue.
onMounted(() => {
router.visit('/getrequest',{
method:'get'
})
})
hopefully someone can pin point what i am missing here.
thanks
App.vue
so that it's not unmounted/mounted again, hence triggering the whole code again.