1.路由页面跳转
import { useRouter } from 'vue-router'
export default defineComponent({
setup() {
const router = useRouter()
router.push('./index')
}
})
2.路由获取path及params
import { useRoute } from 'vue-router'
export default defineComponent({
setup() {
const route = useRoute()
const path = route.path
console.log(path)
}
})