useRoute, useRouter 函数必须写在 setup 中,否则返回 undefined

import { useRouter, useRoute } from ‘vue-router’

export default {
setup() {
const router = useRouter()
const route = useRoute()
}
}

Logo

前往低代码交流专区

更多推荐