feat:替换各个列表接口参数;登录注册合并;发布动态添加视频;分段控件修改
This commit is contained in:
1 parent
298bc6babe
commit
7267cf93c9
22 files changed
+288
-187
No files matched your search
@@ -6,11 +6,11 @@
|
||||
<view
|
||||
class="relative z-10 flex-1 h-40rpx line-height-40rpx text-center text-xs font-500 active:text-color-theme"
|
||||
v-for="(item, index) in items"
|
||||
:key="item"
|
||||
:key="index"
|
||||
:class="{ active: modelValue === index }"
|
||||
@click="segmentedItem(index)"
|
||||
@click="segmentedItem(item, index)"
|
||||
>
|
||||
<text>{{ item }}</text>
|
||||
<text>{{ item.label }}</text>
|
||||
</view>
|
||||
<div
|
||||
class="absolute h-2/3 bg-color-theme-dark rounded-full transform duration-100"
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
items?: string[];
|
||||
items?: { label: string }[];
|
||||
modelValue?: number | string;
|
||||
}>(),
|
||||
{
|
||||
@@ -34,7 +34,7 @@
|
||||
);
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', index: number): void;
|
||||
(e: 'change', target: { currentIndex: number }): void;
|
||||
(e: 'change', target: { label: string }): void;
|
||||
}>();
|
||||
|
||||
const activeStyle = computed(() => {
|
||||
@@ -49,11 +49,9 @@
|
||||
return { width: `${props.items.length * 50}px` };
|
||||
});
|
||||
|
||||
function segmentedItem(index: number) {
|
||||
function segmentedItem(item: { label: string }, index: number) {
|
||||
if (props.modelValue === index) return;
|
||||
emit('update:modelValue', index);
|
||||
emit('change', {
|
||||
currentIndex: index,
|
||||
});
|
||||
emit('change', item);
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user