element-plus走马灯不显示

问题描述

依赖正确,代码用法正确,但是element-plu走马灯就是不显示!!

js 复制代码
 <div class="content">
      <el-carousel height="150px" width="200px">
        <el-carousel-item v-for="item in 4" :key="item">
          <div class="h-100px w-100px">{{ item }}</div>
        </el-carousel-item>
      </el-carousel>
     
    </div>
  </div>



.content {
      display: flex;
      width: 750px;
      height: 256px;
      margin-top: 24px;
      margin-left: 16px;
      overflow: hidden;

      //   div {
      //     margin-left: 20px;
      //     &:first-child {
      //       margin-left: 0;
      //     }
      //   }
    }

并且盒子的宽度总是0


错误排查:

在现有的布局中插入官方的案例,也不能显示

但是把整个页面都使用官方案例就可以正常显示

所以,怀疑时自己的样式冲突了


解决方案:

就content一个盒子,看到 display: flex;就知道不对劲,去掉flex布局就正常了

相关推荐
摘星编程5 小时前
React Native for OpenHarmony 实战:Linking 链接处理详解
javascript·react native·react.js
胖者是谁5 小时前
EasyPlayerPro的使用方法
前端·javascript·css
EndingCoder5 小时前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
摘星编程6 小时前
React Native for OpenHarmony 实战:ImageBackground 背景图片详解
javascript·react native·react.js
摘星编程7 小时前
React Native for OpenHarmony 实战:Alert 警告提示详解
javascript·react native·react.js
Joe5567 小时前
vue2 + antDesign 下拉框限制只能选择2个
服务器·前端·javascript
WHS-_-20227 小时前
Tx and Rx IQ Imbalance Compensation for JCAS in 5G NR
javascript·算法·5g
摘星编程7 小时前
React Native for OpenHarmony 实战:GestureResponderSystem 手势系统详解
javascript·react native·react.js
lili-felicity7 小时前
React Native for OpenHarmony 实战:加载效果的实现详解
javascript·react native·react.js·harmonyos
济6178 小时前
linux 系统移植(第六期)--Uboot移植(5)--bootcmd 和 bootargs 环境变量-- Ubuntu20.04
java·前端·javascript