解决el-table表格没有横向滚动条

表头数据过多,需要添加横向滚动条

解决方法:每个column 中添加min-width属性

html 复制代码
                <!-- 表单表格 -->
                <el-table
                    :data="H5Store.H5list"
                    @selection-change="selectTbhandle"
                    style="width: 100%"
                >
                    <el-table-column type="selection" min-width="60"> </el-table-column>

                    <el-table-column label="模板名称" min-width="180">
                        <template #default="{ row }">
                            <div class="flex">
                                <img
                                    style="width: 100px; height: 60px"
                                    :src="row.templateCover"
                                    alt=""
                                />
                                <p style="font-size: 12px; margin-left: 5px">{{ row.name }}</p>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="templateType" label="模板类型" min-width="100">
                    </el-table-column>
                    <el-table-column prop="industryTypeList" label="适用行业分类" min-width="150">
                    </el-table-column>
                    <el-table-column prop="applicableHolidays" label="适用节日" min-width="120">
                    </el-table-column>
                    <el-table-column prop="applicablePurposeList" label="行业用途" min-width="120">
                    </el-table-column>
                    <el-table-column prop="isShelves" label="是否上架" min-width="100">
                        <template #default="{ row }">
                            <span>{{ row.isShelves ? '已上架' : '已下架' }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="createdTime" label="创建时间" min-width="150">
                    </el-table-column>
                    <el-table-column label="操作" min-width="200">
                        <template #default="{ row }">
                            <div class="flex justify-start">
                                <el-button type="link" @click="Edit(row.id)" size="small"
                                    >编辑</el-button
                                >
                                <el-button
                                    v-if="!row.isShelves"
                                    @click="upisShelves(row)"
                                    type="link"
                                    size="small"
                                    >上架</el-button
                                >
                                <el-button
                                    v-else
                                    @click="downisShelves(row)"
                                    type="link"
                                    size="small"
                                    >下架</el-button
                                >
                                <el-button @click="Del(row.id)" type="link" size="small"
                                    >删除</el-button
                                >
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
相关推荐
昨日余光22 分钟前
建议收藏!我开发了一个免费无限制的AI绘画公益站!
开发语言·前端·javascript·ai作画·typescript
wuhen_n30 分钟前
5年前端,我为什么要all in AI Agent?
前端·vue.js·ai编程
optimistic_chen44 分钟前
【Vue入门】创建Vue工程环境和响应式函数
前端·javascript·vue.js·前端框架·html
xChive1 小时前
ECharts-大屏开发复习记录与踩坑总结
前端·javascript·echarts
林恒smileZAZ1 小时前
告别满屏 v-if:用一个自定义指令搞定 Vue 前端权限控制
前端·javascript·vue.js
wefly20171 小时前
M3U8 播放调试天花板!m3u8live.cn纯网页无广告,音视频开发效率直接拉满
java·前端·javascript·python·音视频
AI论文酱1 小时前
Vue.js入门(搭建第一个页面,新手零配置)
vue.js
SuperEugene2 小时前
NPM Script 实战:常用命令设计与封装|Vue 工程化篇
前端·javascript·vue.js·前端框架·npm
小霍同学2 小时前
Vue 动态表单(Dynamic Form)
前端·vue.js
Dragon Wu2 小时前
Taro 小程序开发注意事项(不定期记录更新)
前端·javascript·小程序·typescript·taro