no message

This commit is contained in:
kuaifan 2021-07-12 18:33:46 +08:00
parent c7dceb29aa
commit 3cf3efc59b
3 changed files with 24 additions and 1 deletions

View File

@ -27,6 +27,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
escClosable: {
type: Boolean,
default: true
},
placement: { placement: {
validator (value) { validator (value) {
return ['right', 'bottom'].includes(value) return ['right', 'bottom'].includes(value)
@ -45,6 +49,14 @@
} }
}, },
mounted () {
document.addEventListener('keydown', this.escClose);
},
beforeDestroy () {
document.removeEventListener('keydown', this.escClose);
},
computed: { computed: {
bodyStyle() { bodyStyle() {
let size = parseInt(this.size); let size = parseInt(this.size);
@ -72,6 +84,13 @@
close() { close() {
this.$emit("input", !this.value) this.$emit("input", !this.value)
}, },
escClose(e) {
if (this.value && this.escClosable) {
if (e.keyCode === 27) {
this.close()
}
}
}
} }
} }
</script> </script>

View File

@ -112,6 +112,7 @@ export default {
handler(info) { handler(info) {
if (this.fileId != info.id) { if (this.fileId != info.id) {
this.fileId = info.id; this.fileId = info.id;
this.contentDetail = null;
this.getContent(); this.getContent();
} }
}, },

View File

@ -195,7 +195,10 @@
</Modal> </Modal>
<!--查看/修改文件--> <!--查看/修改文件-->
<DrawerOverlay v-model="editShow" class="page-file-drawer"> <DrawerOverlay
v-model="editShow"
class="page-file-drawer"
:mask-closable="false">
<FileContent v-if="editShowNum > 0" :parent-show="editShow" :file="editInfo"/> <FileContent v-if="editShowNum > 0" :parent-show="editShow" :file="editInfo"/>
</DrawerOverlay> </DrawerOverlay>