mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
- Adds pagination support for search. - Use composition API on all search related component. - Minor UI improvements. - Adds missing specs Loom video https://www.loom.com/share/5b01afa5c9204e7d97ff81b215621dde?sid=82ca6d22-ca8c-4d5e-8740-ba06ca4051ba
48 lines
914 B
Vue
48 lines
914 B
Vue
<script setup>
|
|
import { ref, watch } from 'vue';
|
|
|
|
const props = defineProps({
|
|
tabs: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
selectedTab: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(['tabChange']);
|
|
|
|
const activeTab = ref(props.selectedTab);
|
|
|
|
watch(
|
|
() => props.selectedTab,
|
|
(value, oldValue) => {
|
|
if (value !== oldValue) {
|
|
activeTab.value = props.selectedTab;
|
|
}
|
|
}
|
|
);
|
|
|
|
const onTabChange = index => {
|
|
activeTab.value = index;
|
|
emit('tabChange', props.tabs[index].key);
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="mt-1 border-b border-n-weak">
|
|
<woot-tabs :index="activeTab" :border="false" @change="onTabChange">
|
|
<woot-tabs-item
|
|
v-for="(item, index) in tabs"
|
|
:key="item.key"
|
|
:index="index"
|
|
:name="item.name"
|
|
:count="item.count"
|
|
:show-badge="item.showBadge"
|
|
/>
|
|
</woot-tabs>
|
|
</div>
|
|
</template>
|