2👍
✅
If you want to execute a function within your component as soon as the component is loaded, you can use the lifecycle hook onMounted
and execute your function within it.
For example:
<script setup>
import { onMounted } from "vue"
import { someFunction } from "./js/allowFunctions.js"
onMounted(() => {
someFunction()
})
</script>
👤Alex
Source:stackexchange.com