mirror of
https://github.com/youzan/vant.git
synced 2026-03-02 02:04:16 +08:00
fix(Popup): can't disable close-on-popstate (#7357)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user