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';
|
import { BindEventMixin } from './bind-event';
|
||||||
|
|
||||||
export const CloseOnPopstateMixin = Vue.extend({
|
export const CloseOnPopstateMixin = Vue.extend({
|
||||||
mixins: [BindEventMixin(function (this: any, bind, isBind) {
|
mixins: [
|
||||||
this.onPopstate(isBind);
|
BindEventMixin(function (this: any, bind, isBind) {
|
||||||
})],
|
this.handlePopstate(isBind && this.closeOnPopstate);
|
||||||
|
})
|
||||||
|
],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
closeOnPopstate: Boolean
|
closeOnPopstate: Boolean
|
||||||
@ -19,12 +21,12 @@ export const CloseOnPopstateMixin = Vue.extend({
|
|||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
closeOnPopstate(val: boolean) {
|
closeOnPopstate(val: boolean) {
|
||||||
this.onPopstate(val);
|
this.handlePopstate(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onPopstate(bind: boolean) {
|
handlePopstate(bind: boolean) {
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (this.$isServer) {
|
if (this.$isServer) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user