-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
同时监听afterchange和close事件签名的事件失效 #61
Comments
+1 |
附上个人解决方案
|
beforeRouteLeave并不能起作用 |
我也想说这个代码,vue-photo-preview这个打开图片的时候url后面是不会变的,只有PC端的那个滑动插件才会变,所以基于url判断是不可靠的 |
@xjy2016 那可能是需要options里面配置history为true,我也只是再我的项目里观察到url后面有变化(打开和切换),才想到监听beforeRouteLeave,切换路由时先关闭。 |
请问你最后有没有解决这个问题 |
@xiazhigithub 我这只是个思路(可以根据url尾部判断),上面的代码是路由跳转离开时才生效关闭的 |
好的 谢谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this.$preview.on('afterChange', res => {
this.showSave = true
})
this.$preview.on('close', res => {
this.showSave = false
this.$preview.self = null
})
The text was updated successfully, but these errors were encountered: