首页 > 其他 > 详细

1.1_视图容器_view

时间:2020-06-03 22:41:51      阅读:42      评论:0      收藏:0      [点我收藏+]

图:

技术分享图片

 

 代码:

<template>
    <view>
        <view v-for="(item,index) in aList" :key="index">
            <view>{{item.text}}</view>
            <view :class="item.cls">
                <view v-for="(item1,index1) in vList" :key="index1" :style="{background:cList[index1]}">
                    {{item1}}
                </view>
            </view>
        </view>
    
    </view>
</template>

<script>
    export default {
        data() {
            return {
                vList:["a","b","c"],
                cList:["#007AFF","#CE3C39","#FFB400"],
                aList:[{cls:"v1",text:"横向布局"},{cls:"v2",text:"纵向布局"}]
            }
        },
        onLoad() {

        },
        methods: {

        }
    }
</script>

<style>
    .v1,v2{
        display: flex;
    }
    .v1 view{
        width: 33%;
        height: 100upx;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .v2 view{
        height: 100upx;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
</style>

 

1.1_视图容器_view

原文:https://www.cnblogs.com/luwei0915/p/13040178.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!