You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Element UI version
2.6.3
OS/Browsers version
chrome
Vue version
2.6.10
Reproduction Link
https://codepen.io/pen/?&editable=true=https%3A%2F%2Felement.eleme.cn%2F
Steps to reproduce
根据源码element/packages/drawer/src/main.vue,closeDrawer方法会触发hide方法,并判断destroyOnClose 为true时,将rendered 置为false,通过el-drawer__body的v-if触发销毁。
而通过visible修改为false来关闭Drawer,只会触发watch,且visible改为false时,并不会判断destroyOnClose 及销毁的操作
附核心源码:
closeDrawer() {
if (typeof this.beforeClose === 'function') {
this.beforeClose(this.hide);
} else {
this.hide();
}
},
hide(cancel) {
if (cancel !== false) {
this.$emit('update:visible', false);
this.$emit('close');
if (this.destroyOnClose === true) {
this.rendered = false;
}
this.closed = true;
}
},
What is Expected?
通过visible修改为false来关闭Drawer,只会触发watch,且visible改为false时,可以增加destroyOnClose 及销毁的操作
What is actually happening?
通过visible修改为false来关闭Drawer,只会触发watch,且visible改为false时,并不会判断destroyOnClose 及销毁的操作
The text was updated successfully, but these errors were encountered: