mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Dialog: closeOnPopstate can't be disabled (#3868)
This commit is contained in:
parent
2a2e43ef90
commit
cc445dfc00
@ -3,9 +3,11 @@ import { on, off } from '../utils/dom/event';
|
||||
import { BindEventMixin } from './bind-event';
|
||||
|
||||
export const CloseOnPopstateMixin = Vue.extend({
|
||||
mixins: [BindEventMixin(function (this: any, bind, isBind) {
|
||||
this.onPopstate(isBind);
|
||||
})],
|
||||
mixins: [
|
||||
BindEventMixin(function (this: any, bind, isBind) {
|
||||
this.handlePopstate(isBind && this.closeOnPopstate);
|
||||
})
|
||||
],
|
||||
|
||||
props: {
|
||||
closeOnPopstate: Boolean
|
||||
@ -19,12 +21,12 @@ export const CloseOnPopstateMixin = Vue.extend({
|
||||
|
||||
watch: {
|
||||
closeOnPopstate(val: boolean) {
|
||||
this.onPopstate(val);
|
||||
this.handlePopstate(val);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onPopstate(bind: boolean) {
|
||||
handlePopstate(bind: boolean) {
|
||||
/* istanbul ignore if */
|
||||
if (this.$isServer) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user