Skip to content

编程式导航

编程式导航,一般用在页面中将其编程到一个按钮中,触发按钮进行路由的跳转:

vue
<template>
	<el-button @click="goTo">使用编程式导航跳转</el-button>
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const goTo = () => {
    router.push("/codeAndCesium/007")
}
</script>

Released under the MIT License.