ptut-vhost/webpack/vue/menu.vue

39 lines
651 B
Vue
Raw Normal View History

<template>
<div id='side-menu'>
<div v-for='(item, index) in gstore.menu_item'
:class="(index == gstore.menu_item_active) ? 'item active' : 'item'"
@click='navigate(index)'
:data-icon='item.icon' :data-label='item.label'>
<!-- <span>{{ item.label }}</span> -->
</div>
</div>
</template>
<script>
export default {
name: 'MENU',
data(){ return { gstore: gstore.get }; },
methods: {
navigate(uri){
2018-03-06 18:39:34 +00:00
// if no logout -> redirect
if( uri !== 'logout' ){
document.location = '/'+uri+'/';
return;
}
// logout call
api.call('DELETE cas', {}, function(rs){ document.location = '/'; });
}
}
}
</script>