vue 进入页面与离开页面触发事件
作者:互联网
1.切换进入当前路由之前的钩子函数
beforeRouteEnter
<script> export default { beforeRouteEnter(to, form, next) { next() } } </script>
2.离开当前路由之前的钩子函数
beforeRouteLeave
<script> export default { beforeRouteLeave(to, form, next) { next() } } </script>
标签:触发,vue,form,default,next,export,beforeRouteEnter,beforeRouteLeave,页面 来源: https://www.cnblogs.com/qianxiaoPro/p/14252932.html