You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately this is inherent to how script setup works. You need to use defineExpose() if you want to use this.now and others. See the generated JS code and you will see nothing is returned inside setup.
Version
4.0.14
Reproduction link
https://codesandbox.io/s/issue-vue3-router-beforerouteenter-q81re4
https://github.com/richex-cn/issue-vue-router-beforeRouteEnter
Steps to reproduce
Open reproduction links, and open console to view result.
In the previous reproduction, The result as follows:
In the second example, The result as follows:
If you remove
<script setup>
, all of them are normal, You can view thedetail.vue
file of two reproductions.What is expected?
Keep consistent result
What is actually happening?
Got inconsistent result
BTW, The current beforeRouteEnter and TypeScript don't seem to work together. Some related issues:
vuejs/vue-router#1863
#701
The text was updated successfully, but these errors were encountered: