39 lines
651 B
Vue
39 lines
651 B
Vue
<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){
|
|
// if no logout -> redirect
|
|
if( uri !== 'logout' ){
|
|
|
|
document.location = '/'+uri+'/';
|
|
return;
|
|
|
|
}
|
|
|
|
// logout call
|
|
api.call('DELETE cas', {}, function(rs){ document.location = '/'; });
|
|
|
|
}
|
|
}
|
|
}
|
|
</script> |