uni-app左右平分九宫格样式

2023-11-16

效果图:

1.template:布局

<template>
    <view class="content">
        <view class="cp-xiangmu" v-for="item in imgs">
            <image :src="item.imgurl" class='cp_tupian' mode='widthFix'></image>
            <text class='cp-biaoti'>{{item.title}}</text>
        </view>
    </view>
</template>

2.script标签中添加测试数据

 3.最重要的是style样式

<style>
    .cp_tupian {
        width: 100%;
    }

    .cp-biaoti {
        font-size: 14px;
        color: gray;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .cp-xiangmu {
        width: 50%;
        display: flex;
        padding: 3px;
        box-sizing: border-box;
        flex-direction: column;
    }

    .content {
        display: flex;
        flex-wrap: wrap;
    }
</style>

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

uni-app左右平分九宫格样式 的相关文章

  • 操作系统 虚拟存储器的概念

    虚拟存储器 程序装入内存时可能会出现如下问题 程序太大 要求的空间超出了内存总容量 有大量作业要求运行 但内存不能容下所有作业 常规存储器管理方式的特征 一次性 要求作业全部装入内存才能运行 驻留性 许多不用或暂时不用的程序占用了大量内存空
  • linux命令strings

    linux命令strings 其man信息如下 strings 1 GNU Development Tools strings 1 NAME strings 显示文件中的可打印字符 总览 SYNOPSIS strings a all f p
  • 二维线段树【模板——给出对应注释】

    闲话少说 直接看注释反而会更容易读懂这段二维线段树的模板 include

随机推荐