import { useRouter } from 'vue-router';
export default {
setup() {
const $router = useRouter();
//点击方法
function go(){
$router.push({ path:'/computed'}) //没有this
}
return{
//方法需要return出去
go
}
}
}
标签:vue,return,跳转,go,router,useRouter,路由
From: https://www.cnblogs.com/java-six/p/16853223.html