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

32 lines
771 B
Vue
Raw Permalink Normal View History

2022-10-20 02:15:28 +02:00
<template>
2023-06-01 15:02:35 +02:00
<div class="flex grow relative">
2024-01-01 18:29:33 +01:00
<ui-menulist v-model="active" :entries="$page.props.setting_menu"></ui-menulist>
2023-06-01 15:02:35 +02:00
<slot></slot>
</div>
2022-10-20 02:15:28 +02:00
</template>
<script>
export default {
data: function () {
return {
2023-06-01 15:02:35 +02:00
innerActive: this.$page.props.setting_menu.findIndex((menu) => menu.is_active),
2022-10-20 02:15:28 +02:00
};
},
computed: {
active: {
get() {
return this.innerActive;
},
2023-06-01 15:02:35 +02:00
set(v) {
2022-10-20 02:15:28 +02:00
var _self = this;
this.$inertia.visit(this.$page.props.setting_menu[v].url, {
2023-06-01 15:02:35 +02:00
onSuccess() {
2022-10-20 02:15:28 +02:00
_self.innerActive = v;
},
});
},
},
},
};
</script>