feat: 对接了首页的接口
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user