diff --git a/dist/action-sheet/index.js b/dist/action-sheet/index.js index aee6999b7..a919bed01 100644 --- a/dist/action-sheet/index.js +++ b/dist/action-sheet/index.js @@ -63,9 +63,11 @@ VantComponent({ onClose() { this.$emit('close'); }, - onClickOverlay() { + onClickOverlay: function () { + if (this.data.closeOnClickOverlay) { this.$emit('click-overlay'); this.onClose(); + } }, }, }); diff --git a/lib/action-sheet/index.js b/lib/action-sheet/index.js index a39818af2..a174a434d 100644 --- a/lib/action-sheet/index.js +++ b/lib/action-sheet/index.js @@ -67,8 +67,11 @@ var button_1 = require("../mixins/button"); this.$emit('close'); }, onClickOverlay: function () { - this.$emit('click-overlay'); - this.onClose(); + const _this = this; + if (_this.data.closeOnClickOverlay) { + _this.$emit('click-overlay'); + _this.onClose(); + } }, }, });