diff --git a/src/components/pages/PanelAdministrator.vue b/src/components/pages/PanelAdministrator.vue index b989c95bef8eb2d440ded07651afbf7f4408357e..8db44d2bb864aef4f763aa4c537c5efea43aabc2 100644 --- a/src/components/pages/PanelAdministrator.vue +++ b/src/components/pages/PanelAdministrator.vue @@ -5,18 +5,18 @@ <b-tabs card> <b-tab title="Komentar" active> <b-card no-body> - <b-tabs pills vertical card> + <b-tabs v-model="tabIndex" pills vertical card> <b-tab title="Entri Komentar" disabled/> <b-tab - v-for="item in pageList" + v-for="(item, index) in pageList" :key=item._id.$oid v-bind:title="item.name"> - <b-tabs content-class="mt-3"> + <b-tabs v-model="tabIndexInner" content-class="mt-3"> <b-tab title="Belum dibalas" active> - <comments :id="item._id.$oid" replyable unreplied/> + <comments :id="item._id.$oid" :ref="index+'-0'" replyable unreplied/> </b-tab> <b-tab title="Semua"> - <comments :id="item._id.$oid" replyable/> + <comments :id="item._id.$oid" :ref="index+'-1'" replyable/> </b-tab> </b-tabs> </b-tab> @@ -58,6 +58,8 @@ export default { perPage: 15, filter: null, selected: 'urusan', + tabIndex: 1, + tabIndexInner: 0, fields: ['urusan', 'admin', 'aksi'], urusan : [ { judul: "Pendapatan", url: "" }, @@ -145,6 +147,14 @@ export default { this.totalRows = this.items.length this.$store.commit('changed','Jenis Anggaran') }, + watch : { + tabIndex() { + this['$refs'][(this.tabIndex-1) + '-' + this.tabIndexInner][0]['refreshContent']() + }, + tabIndexInner() { + this['$refs'][(this.tabIndex-1) + '-' + this.tabIndexInner][0]['refreshContent']() + } + }, methods: { assignAdmin : function(row) { row.item.admin = this.options[this.selected].text