adrema/resources/js/views/setting/Layout.vue

32 lines
768 B
Vue

<template>
<div class="flex grow relative">
<ui-menulist v-model="active" :entries="$page.props.settingMenu"></ui-menulist>
<slot></slot>
</div>
</template>
<script>
export default {
data: function () {
return {
innerActive: this.$page.props.settingMenu.findIndex((menu) => menu.is_active),
};
},
computed: {
active: {
get() {
return this.innerActive;
},
set(v) {
var _self = this;
this.$inertia.visit(this.$page.props.settingMenu[v].url, {
onSuccess() {
_self.innerActive = v;
},
});
},
},
},
};
</script>