mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 23:49:14 +08:00
fix(Popup): can't disable close-on-popstate (#7357)
This commit is contained in:
parent
efc05af6f6
commit
2b49ca60f4
@ -25,6 +25,11 @@ export const CloseOnPopstateMixin = {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onPopstate() {
|
||||
this.close();
|
||||
this.shouldReopen = false;
|
||||
},
|
||||
|
||||
handlePopstate(bind) {
|
||||
/* istanbul ignore if */
|
||||
if (this.$isServer) {
|
||||
@ -34,10 +39,7 @@ export const CloseOnPopstateMixin = {
|
||||
if (this.bindStatus !== bind) {
|
||||
this.bindStatus = bind;
|
||||
const action = bind ? on : off;
|
||||
action(window, 'popstate', () => {
|
||||
this.close();
|
||||
this.shouldReopen = false;
|
||||
});
|
||||
action(window, 'popstate', this.onPopstate);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user