码迷,mamicode.com
首页 > 其他好文 > 详细

demo_06 引入图标库及创建选项卡组件

时间:2020-07-20 10:34:31      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:rap   pos   dem   引入   shrink   dex   ack   content   osi   

img:

技术图片

 tab:

<template>
    <view class="tab">
        <scroll-view class="tab-scroll" scroll-x>
            <view class="tab-scroll_box">
                <view v-for="(item,index) in list" :key="index" class="tab-scroll_item">{{item.name}}</view>
            </view>
        </scroll-view>
        <view class="tab-icons">
            <uni-icons type="gear" size="26" color="#666"></uni-icons>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                list: [{
                        name: ‘uni-app‘
                    },
                    {
                        name: ‘vue‘
                    },
                    {
                        name: ‘html‘
                    },
                    {
                        name: ‘javascript‘
                    },
                    {
                        name: ‘jquery‘
                    },
                    {
                        name: ‘ajax‘
                    },
                    {
                        name: ‘react‘
                    },
                    {
                        name: ‘css3‘
                    }
                ]
            };
        }
    }
</script>

<style lang="scss">
    .tab {
        display: flex;
        width: 100%;
        border-bottom: 1px #f5f5f5 solid;
        background-color: #fff;
        box-sizing: border-box;

        .tab-scroll {
            flex: 1;
            overflow: hidden;
            box-sizing: border-box;

            .tab-scroll_box {
                display: flex;
                align-items: center;
                flex-wrap: nowrap;
                height: 45px;
                box-sizing: border-box;

                .tab-scroll_item {
                    flex-shrink: 0;
                    padding: 0 10px;
                    color: #333;
                    font-size: 14px;
                }
            }
        }

        .tab-icons {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 45px;

            &::after {
                content: ‘‘;
                position: absolute;
                top: 12px;
                bottom: 12px;
                left: 0;
                width: 1px;
                background-color: #ddd;
            }
        }
    }
</style>

demo_06 引入图标库及创建选项卡组件

标签:rap   pos   dem   引入   shrink   dex   ack   content   osi   

原文地址:https://www.cnblogs.com/luwei0915/p/13343155.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!