nanka iroiro

This commit is contained in:
syuilo
2020-02-08 23:52:40 +09:00
parent 78c2535c3c
commit 2f6b0b142a
5 changed files with 213 additions and 232 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="mk-popup">
<div class="mk-popup" v-hotkey.global="keymap">
<transition :name="$store.state.device.animation ? 'bg-fade' : ''" appear>
<div class="bg" ref="bg" @click="close()" v-if="show"></div>
</transition>
@@ -35,6 +35,13 @@ export default Vue.extend({
show: true,
};
},
computed: {
keymap(): any {
return {
'esc': this.close,
};
},
},
mounted() {
this.$nextTick(() => {
const popover = this.$refs.content as any;
@@ -96,8 +103,8 @@ export default Vue.extend({
methods: {
close() {
this.show = false;
(this.$refs.bg as any).style.pointerEvents = 'none';
(this.$refs.content as any).style.pointerEvents = 'none';
if (this.$refs.bg) (this.$refs.bg as any).style.pointerEvents = 'none';
if (this.$refs.content) (this.$refs.content as any).style.pointerEvents = 'none';
}
}
});