<template> <div id="test2_nav"> <button @click="test2_home()">Test2Home</button> </div> </template> <script> // @ is an alias to /src // import HelloWorld from '@/components/HelloWorld.vue' // import {useRouter} from 'vue-router' import router from "../router"; export default { setup(){ const test2_home = () =>{ // console.log("test2_home"); router.push('/home'); // router.replace('/home'); } return { test2_home } } } </script>