32 lines
573 B
Vue
32 lines
573 B
Vue
|
<template>
|
||
|
|
||
|
<div id='MENU'>
|
||
|
|
||
|
<div v-for='(item, index) in gstore.menu_item' class='menu-item-wrapper'>
|
||
|
|
||
|
<div :class="(index == gstore.menu_item_active) ? 'menu-item active' : 'menu-item'" @click='navigate_menu(index)'>{{ item.label }}</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</template>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
|
name: 'MENU',
|
||
|
data(){ return { gstore: window.gstore.data }; },
|
||
|
methods: {
|
||
|
navigate_menu(page){
|
||
|
|
||
|
// (1) Manage action
|
||
|
console.log('Loading page \''+page+'\'');
|
||
|
|
||
|
// (2) Activate current element
|
||
|
this.gstore.menu_item_active = page;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|