Add new shortcut

This commit is contained in:
syuilo 2018-09-19 02:51:06 +09:00
parent a23b8cebbc
commit 609d68933e
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="account"> <div class="account" v-hotkey.global="keymap">
<button class="header" :data-active="isOpen" @click="toggle"> <button class="header" :data-active="isOpen" @click="toggle">
<span class="username">{{ $store.state.i.username }}<template v-if="!isOpen">%fa:angle-down%</template><template v-if="isOpen">%fa:angle-up%</template></span> <span class="username">{{ $store.state.i.username }}<template v-if="!isOpen">%fa:angle-down%</template><template v-if="isOpen">%fa:angle-up%</template></span>
<mk-avatar class="avatar" :user="$store.state.i"/> <mk-avatar class="avatar" :user="$store.state.i"/>
@ -63,6 +63,13 @@ export default Vue.extend({
isOpen: false isOpen: false
}; };
}, },
computed: {
keymap(): any {
return {
'a|m': this.toggle
};
}
},
beforeDestroy() { beforeDestroy() {
this.close(); this.close();
}, },