Houjie
2025-04-11 1bf977929dd324f3ac64b70debd8a79443c54392
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<template>
    <view>
        <cu-custom bgColor="bg-gradual-pink" :isBack="true"><block slot="backText">返回</block><block slot="content">导航栏</block></cu-custom>
        <view v-for="(item,index) in 10" :key="index" v-if="index==TabCur" class="bg-grey padding margin text-center">
            Tab{{index}}
        </view>
        <view class="cu-bar bg-white solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-orange"></text> 默认
            </view>
        </view>
        <scroll-view scroll-x class="bg-white nav" scroll-with-animation :scroll-left="scrollLeft">
            <view class="cu-item" :class="index==TabCur?'text-green cur':''" v-for="(item,index) in 10" :key="index" @tap="tabSelect" :data-id="index">
                Tab{{index}}
            </view>
        </scroll-view>
 
        <view class="cu-bar bg-white margin-top solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-orange"></text> 居中
            </view>
        </view>
        <scroll-view scroll-x class="bg-white nav text-center">
            <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in 3" :key="index" @tap="tabSelect" :data-id="index">
                Tab{{index}}
            </view>
        </scroll-view>
 
        <view class="cu-bar bg-white margin-top solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-orange"></text> 平分
            </view>
        </view>
        <scroll-view scroll-x class="bg-white nav">
            <view class="flex text-center">
                <view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" v-for="(item,index) in 4" :key="index" @tap="tabSelect" :data-id="index">
                    Tab{{index}}
                </view>
            </view>
        </scroll-view>
        <view class="cu-bar bg-white margin-top solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-orange"></text> 背景
            </view>
        </view>
        <scroll-view scroll-x class="bg-red nav text-center">
            <view class="cu-item" :class="index==TabCur?'text-white cur':''" v-for="(item,index) in 3" :key="index" @tap="tabSelect" :data-id="index">
                Tab{{index}}
            </view>
        </scroll-view>
        <view class="cu-bar bg-white margin-top solid-bottom">
            <view class="action">
                <text class="cuIcon-title text-orange"></text> 图标
            </view>
        </view>
        <scroll-view scroll-x class="bg-green nav text-center">
            <view class="cu-item" :class="0==TabCur?'text-white cur':''" @tap="tabSelect" data-id="0">
                <text class="cuIcon-camerafill"></text> 数码
            </view>
            <view class="cu-item" :class="1==TabCur?'text-white cur':''" @tap="tabSelect" data-id="1">
                <text class="cuIcon-upstagefill"></text> 排行榜
            </view>
            <view class="cu-item" :class="2==TabCur?'text-white cur':''" @tap="tabSelect" data-id="2">
                <text class="cuIcon-clothesfill"></text> 皮肤
            </view>
        </scroll-view>
 
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                TabCur: 0,
                scrollLeft: 0
            };
        },
        methods: {
            tabSelect(e) {
                this.TabCur = e.currentTarget.dataset.id;
                this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
            }
        }
    }
</script>
 
<style>
 
</style>