diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index 0ace491..51a529b 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -132,7 +132,8 @@ }, handleWrapClick (event) { // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className - if (event.target.getAttribute('class').indexOf(`${prefixCls}-wrap`) > -1) this.mask(); + const className = event.target.getAttribute('class'); + if (className && className.indexOf(`${prefixCls}-wrap`) > -1) this.mask(); }, cancel () { this.close(); -- libgit2 0.21.4