您的位置:首页 > 房产 > 建筑 > 推广系统建站_公司宣传折页模板_sem和seo是什么职业岗位_营销案例100例小故事

推广系统建站_公司宣传折页模板_sem和seo是什么职业岗位_营销案例100例小故事

2025/2/24 16:04:50 来源:https://blog.csdn.net/zzzzzzzi111/article/details/144443947  浏览:    关键词:推广系统建站_公司宣传折页模板_sem和seo是什么职业岗位_营销案例100例小故事
推广系统建站_公司宣传折页模板_sem和seo是什么职业岗位_营销案例100例小故事

第一步:配置好需要作为tabbar页面的路径,并将custom属性设置为true,

第二部:tabbar组件的封装

<template>

<view class="tabbar">

<view class="item" v-for="(item,index) in list" :key="index" @click="goNav(item.pagePath,index)">
                <view class="flex h-column h-center">
                    <image :src="current==index?item.selectedIconPath:item.iconPath"></image>
                    <view class="name" :class="current==index?'name-select':''">
                        {{item.text}}
                    </view>
                </view>

            </view>

</view>

</template>

<script>

export default{

props: ['current'],

data(){

return{

list: [{
                        iconPath: "../../../static/meijia/icon_navhome.png",
                        selectedIconPath: "../../../static/meijia/icon_navh_home.png",
                        text: '首页',
                        pagePath: '/pages/index/index',
                    },
                    {
                        iconPath: "../../../static/meijia/icon_navmy.png",
                        selectedIconPath: "../../../static/meijia/icon_navh_my.png",
                        text: '我的',
                        pagePath: '/pages/my/index',
                    },
                ]

}

},

methods:{

goNav(url,index) {
                uni.switchTab({
                    url: url
                })
            }

}

}

</script>

<style lang="scss" scoped>

.tabbar {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        background-color: rgb(255, 255, 255);
        // border-top: 2rpx solid rgb(213, 215, 214);
        padding: 20rpx 50rpx;
        display: flex;
        justify-content: space-between;

        .item {
            display: flex;
            align-items: center;
            padding-bottom: 20rpx;

            image {
                width: 54rpx;
                height: 54rpx;

            }

            .name {
                color: rgb(151, 152, 154);
                font-size: 24rpx;
            }

            .name-select {
                color: #333;
                font-weight: bold;
            }
        }
    }

</style>

第三步:在组件中使用,current的值即当前页面在tabbar页面数组中的索引

<tabbar :current="0" ></tabbar>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com