1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00
wakapi/static/assets/js/components/menu-main.js
2022-01-02 12:02:12 +01:00

14 lines
452 B
JavaScript

PetiteVue.createApp({
$delimiters: ['${', '}'],
state: {
showDropdownResources: false,
showDropdownUser: false,
showApiKey: false
},
mounted() {
window.addEventListener('click', (e) => {
const skip = findParentAttribute(e.target, 'data-trigger-for')?.value
Object.keys(this.state).filter(k => k !== skip).forEach(k => this.state[k] = false)
})
}
}).mount('#main-menu')