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

38 lines
920 B
Vue
Raw Normal View History

2022-10-20 02:15:28 +02:00
<template>
2023-04-29 23:41:26 +02:00
<page-layout>
<div class="flex grow relative">
2023-05-19 01:06:46 +02:00
<ui-tabs v-model="active" :entries="$page.props.setting_menu"></ui-tabs>
2023-04-29 23:41:26 +02:00
<slot></slot>
</div>
</page-layout>
2022-10-20 02:15:28 +02:00
</template>
<script>
export default {
data: function () {
return {
innerActive: 0,
};
},
computed: {
active: {
get() {
return this.innerActive;
},
set(v, old) {
var _self = this;
this.$inertia.visit(this.$page.props.setting_menu[v].url, {
onSuccess(page) {
console.log('A');
_self.innerActive = v;
},
});
},
},
},
mounted() {
this.innerActive = this.$page.props.setting_menu.findIndex((menu) => menu.is_active);
},
};
</script>