vue2.7如何在setup中使用beforeRouteEnter #9718
Unanswered
Miofly
asked this question in
Help/Questions
Replies: 2 comments 3 replies
-
如果你是用optionsAPI的setup你应该可以从root.$router获取到 |
Beta Was this translation helpful? Give feedback.
3 replies
-
defineComponent: <script lang="ts">
export default defineComponent({
beforeRouteEnter(to, from, next) {
/* code */
next()
}
})
</script> script setup: <script lang="ts" setup>
defineOptions({
beforeRouteEnter(to, from, next) {
/* code */
next()
}
})
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
vue2.7如何在setup中使用beforeRouteEnter
Beta Was this translation helpful? Give feedback.
All reactions