1.切换进入当前路由之前的钩子函数
beforeRouteEnter
1 2 3 4 5 6 7 |
<script> export default { beforeRouteEnter(to, form, next) { next() } } </script> |
2.离开当前路由之前的钩子函数
beforeRouteLeave
1 2 3 4 5 6 7 |
<script> export default { beforeRouteLeave(to, form, next) { next() } } </script> |
from:https://www.cnblogs.com/gqx-html/p/11233014.html