feat: 对接了首页的接口

This commit is contained in:
2026-04-28 22:47:10 +08:00
parent c35a97d6da
commit 3b0fb23a5c
5 changed files with 104 additions and 21 deletions

View File

@@ -8,7 +8,7 @@
:id="'tab-' + idx"
class="tab-item"
:class="{ active: modelValue === idx }"
@tap="handleSwitch(idx)"
@tap="handleSwitch(tab, idx)"
>
<view class="tab-content">
<view class="tab-label">
@@ -29,21 +29,15 @@ const props = defineProps({
modelValue: { type: Number, default: 0 },
tabs: {
type: Array,
default: () => [
{ label: '小七孔古桥' },
{ label: '翠谷瀑布' },
{ label: '鸳鸯湖' },
{ label: '天河潭' },
{ label: '卧龙潭' }
],
default: () => [],
},
});
const emit = defineEmits(['update:modelValue', 'change']);
const handleSwitch = (i) => {
emit('update:modelValue', i);
emit('change', i);
const handleSwitch = (tab, idx) => {
emit('update:modelValue', idx);
emit('change', { tab, idx });
};
</script>