不要乱用position:fixed

本文详细解析了在网页设计中,如何正确使用相对定位、绝对定位和固定定位,避免常见误区,确保操作按钮在滚动窗口中固定显示,同时保持良好的布局效果。

经常会有一个需求,在一个固定窗口内容滚动,底下有操作按钮需要固定,不随着滚动,一般第一个念头就是用固定定位position: fixed,但是fixed是以窗口为父元素去定位的,这么做肯定是错的,需要正确使用相对定位和绝对定位

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<style>
.wrap {
    position: relative;
    width: 200px;
    border: 1px solid #ccc;
}
.content{
    width: 200px;
    height: 300px;
    overflow: auto;
    margin-bottom: 50px;
    border: 1px solid #ccc;
}
.item {
    width: 100%;
    height: 100px;
    background: red;
    margin-bottom: 10px;
}
.btn {
    position: absolute;
    bottom: 0;
    background: #fff;
    width: 100%;
    height: 50px;
}
</style>
</head>
<body>
<div class="wrap">
    <div class="content">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="btn">按钮</div>
    </div>
</div>
</body>
</html>

position:fixed 相对父元素定位

position:fixed是对于浏览器窗口定位的,要实现相当于父元素定位,可以这样:

不设置fixed元素的top,bottom,left,right,只设置margin来实现。

这种方法本质上fixed元素还是相当于窗口定位的,实现效果上是相对于父元素定位。

此外,position:fixed元素会受到父元素的影响,而出现不能以窗口进行定位:

  1. 因为fixed元素并不总是相对于视窗进行定位的,父元素发生变换,也就是transfrom属性发生改变,如平移或旋转,会对固定定位的子元素产生影响 例子:固定定位不固定。
<div class='container'>
  <div class='fix'>我固定了吗?</div>
</div>
.container{
  width: 200px;
  height: 200px;
  line-height: 200px;
  text-align: center;
  background: #6699FF;
  animation: move 4s cubic-bezier(0.4,0,0.6,1) infinite;
}
.fix{
  position: fixed;
  top: 20px;
  left: 20px;
  width: 200px;
  height: 200px;
  background: #9966FF;
  color:#FFF;
}
@keyframes move{
  0% {transform:translateX(100px);}
  50% {transform:translateX(500px);}
  100% {transform:translateX(100px);}
}
  1. 如果父级元素的z-index的层次比同级元素低,就算fixedz-index比父级高,也会被父级同级元素遮挡。

因此,position:fixed元素若要以窗口进行定位,最好是放在body根标签下

<template> <zy-voice-recorder ref="voiceRecorder" @start="onRecordStart" @stop="onRecordStop" @error="onRecordError"> <view class="sound-container" v-show="showSoundCom" :style="{ 'background-image': `linear-gradient(179deg, rgba(255, 255, 255, 0) 0%, #ffffff ${soundTop}px)` }" > <view class="sound-content" :style="{ top: `${soundTop - 16}px` }" > <view class="sound-conten-wave"> <view class="sound-conten-wave-bg"> <view class="wave"> <div class="voice-container"> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> <div class="bar"></div> </div> </view> <view class="arrow-cion"></view> </view> <view class="text">松开结束语音转文字</view> </view> <view class="sound-content-icon"> <uni-icons v-show="soundTop != 0" type="yuyinzhong" color="#0F56D5" size="17" class="mic-icon" style="position: absolute; font-size: 17px; left: 70%; top: 50%; transform: translate(-50%, -50%)" /> <image class="img" lazy-load src="https://gateway-in.rosino.com/prod/biz-zy-gateway/admin-api/infra/file/22/get/xzzl/sound.png" mode="widthFix" /> </view> </view> </view> </zy-voice-recorder> </template> <script lang="ts" setup> interface Props { soundTop: number visible: boolean } const props = withDefaults(defineProps<Props>(), { visible: false, soundTop: 0 }) const $emit = defineEmits<{ (e: 'end', value: string): void }>() const showSoundCom = ref(false) const voiceRecorder = ref() // 录音开始回调 function onRecordStart(res: any) { console.log('录音开始', res) } // 录音结束回调 function onRecordStop(data: any) { console.log('录音结束', data) $emit('end', data.result) // 如果需要,可以在这里处理录音文件和识别结果 // const audioPath = data.tempFilePath; // const result = data.result; } // 录音错误回调 function onRecordError(res: any) { console.error('录音错误', res) } watch( () => props.visible, async val => { if (val) { showSoundCom.value = true // 等待 Vue 更新 DOM await nextTick() // 再等待一帧,确保样式和布局完成(约 16ms) setTimeout(() => { voiceRecorder.value?.startRecord() }, 16) } else { voiceRecorder.value?.stopRecord?.() showSoundCom.value = false } }, { immediate: false, deep: true } ) </script> <style scoped lang="scss"> .sound-container { top: 0; position: fixed; z-index: 99; height: 100vh; width: 100%; .sound-content { width: 100%; // position: absolute; display: flex; justify-content: center; align-items: center; position: relative; .sound-conten-wave { .sound-conten-wave-bg { display: flex; align-items: center; } .arrow-cion { border: 8px solid #5b8ff9; border-color: transparent transparent transparent #5b8ff9; } .wave { width: 190px; height: 60px; display: flex; align-items: center; background: #5b8ff9; border-radius: 4px; justify-content: center; .voice-container { display: flex; align-items: center; justify-content: center; height: 30px; gap: 2px; /* 条形间距 */ @keyframes wave { 0%, 100% { height: 15px; } /* 最矮状态 */ 50% { height: 8px; } /* 最高状态 */ } .bar { width: 2px; height: 15px; background-color: #fff; /* 微信绿色 */ border-radius: 3px; animation: wave 1.2s infinite ease-in-out; } .bar:nth-child(1) { animation-delay: 0s; } .bar:nth-child(2) { animation-delay: 0.2s; } .bar:nth-child(3) { animation-delay: 0.4s; } .bar:nth-child(4) { animation-delay: 0.6s; } .bar:nth-child(5) { animation-delay: 0.8s; } .bar:nth-child(6) { animation-delay: 0s; } .bar:nth-child(7) { animation-delay: 0.2s; } .bar:nth-child(8) { animation-delay: 0.4s; } .bar:nth-child(9) { animation-delay: 0.6s; } .bar:nth-child(10) { animation-delay: 0.8s; } .bar:nth-child(11) { animation-delay: 0s; } .bar:nth-child(12) { animation-delay: 0.2s; } .bar:nth-child(13) { animation-delay: 0.4s; } .bar:nth-child(14) { animation-delay: 0.6s; } .bar:nth-child(15) { animation-delay: 0.8s; } .bar:nth-child(16) { animation-delay: 0s; } .bar:nth-child(17) { animation-delay: 0.2s; } .bar:nth-child(18) { animation-delay: 0.4s; } .bar:nth-child(19) { animation-delay: 0.6s; } .bar:nth-child(20) { animation-delay: 0.8s; } .bar:nth-child(21) { animation-delay: 0s; } .bar:nth-child(22) { animation-delay: 0.2s; } .bar:nth-child(23) { animation-delay: 0.4s; } .bar:nth-child(24) { animation-delay: 0.6s; } .bar:nth-child(25) { animation-delay: 0.8s; } } } .text { font-size: 14px; padding: 12px 8px 0 0; color: #999999; text-align: center; } } .sound-content-icon { position: absolute; right: 0; top: -45px; width: 80px; .img { width: 100%; vertical-align: top; } } } } .mic-icon { position: absolute; font-size: 17px; left: 70%; top: 50%; transform: translate(-50%, -50%); } </style> icon还是会出现在点击后展示的图片的上边,然后闪现回到图片的中间
最新发布
11-18
<template> <el-dialog :title="dialogMode === 'create' ? '新建' : dialogMode === 'edit' ? '修改' : '查看'" :visible.sync="dialogVisible" :modal-append-to-body="true" append-to-body :close-on-click-modal="false" custom-class="fixed-height-dialog" width="60%" top="5vh"> <el-form label-width="80px" ref="formRef" :model="currentForm" style="height: 100%; display: flex; flex-direction: column;" :rules="rules"> <!-- 项目信息区域 --> <div class="formBorder"> <el-row :gutter="10"> <el-col :span="6"> <el-form-item size="mini" label="项目名称" prop="projectName"> <el-input v-model="currentForm.projectName" clearable style="width:100%" size="mini" :disabled="dialogMode === 'view'"></el-input> </el-form-item> </el-col> <el-col :span="6"> <el-form-item size="mini" label="项目编号" prop="projectCode"> <el-input v-model="currentForm.projectCode" clearable style="width:100%" size="mini" :disabled="dialogMode === 'view'"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item size="mini" label="项目周期" prop="projectDate"> <el-date-picker v-model="projectDate" range-separator="→" start-placeholder="请选择开始日期" end-placeholder="请选择结束日期" type="daterange" size="mini" style="width: 100%;" unlink-panels :disabled="dialogMode === 'view'"> </el-date-picker> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="6"> <el-form-item label="负责人" size="mini" style="width: fit-content;"> <el-input v-model="currentForm.projectUser" clearable style="width:100%" size="mini" :disabled="dialogMode === 'view'"></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="24"> <el-form-item label="项目概述"> <el-input v-model="currentForm.remark" :rows="2" :disabled="dialogMode === 'view'"></el-input> </el-form-item> </el-col> </el-row> </div> <!-- 待检边坡区域 --> <div class="formBorder2" style="flex: 1; min-height: 0; display: flex; flex-direction: column;"> <el-container style="height: 100%; display: flex; flex-direction: column;"> <!-- 搜索区域 --> <el-header style="height: auto; flex-shrink: 0; padding-bottom: 10px;"> <el-row :gutter="10" type="flex" class="searchDialog"> <el-col :span="5"> <el-select v-model="filterForm.maintenanceCompanyName" placeholder="请选择管养单位" size="mini" clearable filterable @clear="resetSearch" :disabled="dialogMode === 'view'"> <el-option v-for="item in MaintenanceUnitoptions" :key="item.value" :label="item.label" :value="item.value"></el-option> </el-select> </el-col> <el-col :span="5"> <el-select v-model="filterForm.routeCode" placeholder="请选择路线编号" size="mini" clearable filterable @clear="resetSearch" :disabled="dialogMode === 'view'"> <el-option v-for="item in routeCodeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> </el-select> </el-col> <el-col :span="5"> <el-input v-model="filterForm.searchKey" placeholder="请输入边坡编号或名称" size="mini" clearable @keyup.enter.native="searchForm" @clear="resetSearch" :disabled="dialogMode === 'view'"> <i slot="suffix" class="el-input__icon el-icon-search"></i> </el-input> </el-col> <el-col :span="5"> <el-select v-model="filterForm.evaluateLevel" placeholder="请选择技术状态等级" size="mini" clearable @clear="resetSearch" :disabled="dialogMode === 'view'"> <el-option v-for="item in evaluateLeveloptions" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-col> <el-col :span="2" :offset="4"> <el-button type="primary" size="mini" style="width:100%" icon="el-icon-search" @click="searchForm" :loading="loading" :disabled="dialogMode === 'view'">搜索</el-button> </el-col> </el-row> </el-header> <!-- 边坡表格 --> <el-main style="flex: 1; overflow-y: auto; padding: 0;"> <el-table ref="scrollTable" v-loading="loading" style="width: 100%;" border :data="formTabledata" :height="tableHeight" :header-row-style="{ height: '40px' }" :header-cell-style="{ padding: '0', height: '40px', lineHeight: '40px', textAlign: 'center', }" :cell-style="{ textAlign: 'center' }" @selection-change="handleSelectionChange" :row-key="getRowkey"> <!-- 选择列(查看模式禁用) --> <el-table-column type="selection" width="55" :selectable="isRowSelectable" :reserve-selection="true"> </el-table-column> <!-- 其他数据列 --> <el-table-column label="管养单位" prop="maintenanceCompanyName" width="290" show-overflow-tooltip></el-table-column> <el-table-column label="路线编号" prop="routeCode" width="100"></el-table-column> <el-table-column label="边坡编号" prop="sideSlopeCode" width="240" show-overflow-tooltip></el-table-column> <el-table-column label="边坡名称" prop="sideSlopeName" width="267" show-overflow-tooltip></el-table-column> <el-table-column label="技术状态等级" width="137"> <template slot-scope="scope"> {{ mapEvaluateLevel(scope.row.evaluateLevel) }} </template> </el-table-column> </el-table> </el-main> <!-- 分页区域 --> <el-footer style="flex-shrink: 0; padding-top: 10px;"> <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageParams.pageNo" :page-sizes="[10, 20, 50, 100]" :page-size="pageParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"> </el-pagination> </el-footer> </el-container> </div> </el-form> <!-- 弹窗底部按钮 --> <div slot="footer" class="dialog-footer" v-if="dialogMode === 'create' || dialogMode === 'edit'"> <el-button @click="dialogVisible = false">取消</el-button> <el-button type="primary" @click="submitForm">提交</el-button> </div> </el-dialog> </template> <script> import { mapCfg } from "@/utils"; import { getPeriodicInspectionSideSlopePageList, addPeriodicInspection, modifyPeriodicInspection, getSelectedPeriodicInspectionSideSlopeList } from "../../api/testProject"; import { getMaintenanceCompanyList, getRouteList } from "../../api/basicInformation"; export default { name: "SideSlopeDialog", props: { visible: Boolean, // 控制弹窗显示 mode: String, // 模式:create/edit/view initialForm: Object, // 初始表单数据 }, data() { return { dialogVisible: this.visible, // 弹窗显示状态 dialogMode: this.mode, // 当前模式 currentForm: { ...this.initialForm }, // 当前表单数据 projectDate: [], // 项目日期范围 total: 0, // 总数据量 loading: false, // 加载状态 pageParams: { // 分页参数 pageNo: 1, pageSize: 10, }, filterForm: { // 搜索条件 maintenanceCompanyName: "", routeCode: "", searchKey: "", evaluateLevel: "", }, allSelection: new Map(), // 存储所有选择的边坡(使用Map提高性能) MaintenanceUnitoptions: [], // 管养单位选项 routeCodeOptions: [], // 路线编号选项 formTabledata: [], // 表格数据 evaluateLeveloptions: [], // 技术状态等级选项 tableHeight: 200, // 表格高度 rules: { // 表单验证规则 projectName: [ { required: true, message: "项目名称不能为空", trigger: "blur" }, ], projectCode: [ { required: true, message: "项目编码不能为空", trigger: "blur" }, ], }, }; }, watch: { // 监听模式变化 mode(val) { this.dialogMode = val; }, // 监听弹窗显示状态变化 visible(val) { this.dialogVisible = val; if (val) { // 关键修改:打开对话框时不加载列表数据 if (this.dialogMode !== 'create' && this.currentForm.id) { // 只获取已选边坡数据,不加载列表 this.getSelectedSlopes(); } else { // 新建模式:重置选择状态 this.resetSelection(); // 清空表格数据 this.formTabledata = []; this.total = 0; } this.$nextTick(() => { this.calculateTableHeight(); }); } else { // 关闭弹窗时重置选择状态 this.resetSelection(); } }, // 同步弹窗显示状态到父组件 dialogVisible(val) { this.$emit("update:visible", val); }, // 监听初始表单数据变化 initialForm: { deep: true, handler(val) { this.currentForm = { ...val }; this.projectDate = val.projectStartDate && val.projectEndDate ? [val.projectStartDate, val.projectEndDate] : []; // 关键修改:表单数据更新后重新加载已选边坡 if (this.dialogVisible && this.dialogMode !== 'create' && val.id) { this.getSelectedSlopes(); } }, }, // 处理日期范围变化 projectDate: { deep: true, handler(value) { if (value && value.length === 2) { this.currentForm.projectStartDate = value[0]; this.currentForm.projectEndDate = value[1]; } }, }, }, async created() { // 初始化数据 this.getRouteList(); await this.getEvaluateLevel(); this.getMaintenanceCompanyList(); }, mounted() { // 计算表格高度并监听窗口变化 this.calculateTableHeight(); window.addEventListener("resize", this.calculateTableHeight); }, beforeDestroy() { // 移除事件监听 window.removeEventListener("resize", this.calculateTableHeight); }, methods: { getRowkey(row) { return row.id }, // 获取已选择的边坡(优化版) async getSelectedSlopes() { try { this.resetSelection(); const params = { periodicId: this.currentForm.id, pageNo: 1, pageSize: 1000 }; const res = await getSelectedPeriodicInspectionSideSlopeList(params); // 关键修改:将已选边坡数据赋值给表格 const selectedSlopes = res.entities || []; this.formTabledata = selectedSlopes; // 显示已选边坡 this.total = selectedSlopes.length; // 设置总条数 // 存储所有已选边坡 this.allSelection = new Map(); selectedSlopes.forEach(item => { this.allSelection.set(item.sideSlopeUniqueCode, item); }); // 设置表格选中状态 this.$nextTick(() => { this.setSelectedRows(); }); } catch (error) { console.error('获取已选边坡失败', error); this.$message.error('获取已选边坡数据失败'); this.formTabledata = []; this.total = 0; } }, // 设置选中行 // 修改后的setSelectedRows方法 setSelectedRows() { if (!this.$refs.scrollTable) return; // 清除所有选中状态 this.$refs.scrollTable.clearSelection(); // 检查是否有选中项 if (this.allSelection.size > 0) { // 创建唯一标识映射 const sideSlopeUniqueCode = new Set(Array.from(this.allSelection.keys())); // 遍历表格数据设置选中状态 this.formTabledata.forEach(row => { if (sideSlopeUniqueCode.has(row.sideSlopeUniqueCode)) { this.$refs.scrollTable.toggleRowSelection(row, true); } }); } }, // 判断行是否可选(查看模式禁用选择) isRowSelectable(row, index) { return this.dialogMode !== "view"; }, // 获取管养单位列表 async getMaintenanceCompanyList() { const res = await getMaintenanceCompanyList(); this.MaintenanceUnitoptions = res.map((item) => ({ value: item, label: item, })); }, // 获取路线列表 async getRouteList() { const res = await getRouteList(); this.routeCodeOptions = res.map((item) => ({ value: item.id, label: item.routeCode, })); }, // 搜索方法 searchForm() { this.pageParams.pageNo = 1; this.LoadListData(); }, // 重置搜索条件 resetSearch() { this.filterForm = { maintenanceCompanyName: "", routeCode: "", searchKey: "", evaluateLevel: "", }; this.pageParams.pageNo = 1; this.LoadListData(); }, // 重置选择状态 resetSelection() { this.allSelection = new Map(); if (this.$refs.scrollTable) { this.$refs.scrollTable.clearSelection(); } }, // 处理选择变化 handleSelectionChange(val) { // 查看模式不允许修改选择 if (this.dialogMode === 'view') return; // 创建当前页行ID的Set const currentPageIds = new Set( this.formTabledata.map(item => item.sideSlopeUniqueCode) ); // 移除当前页不在新选择中的行 for (const key of this.allSelection.keys()) { if (currentPageIds.has(key)) { this.allSelection.delete(key); } } // 添加新选择的行 val.forEach(row => { this.allSelection.set(row.sideSlopeUniqueCode, row); }); }, // 映射技术状态等级 mapEvaluateLevel(level) { const option = this.evaluateLeveloptions.find( (item) => item.value === level ); return option ? option.label : ''; }, // 加载表格数据 async LoadListData() { this.loading = true; const params = { orgId: this.filterForm.maintenanceCompanyName, routeId: this.filterForm.routeCode, searchKey: this.filterForm.searchKey, evaluateLevel: this.filterForm.evaluateLevel, pageSize: this.pageParams.pageSize, pageNo: this.pageParams.pageNo, }; try { // 获取表格数据 const res = await getPeriodicInspectionSideSlopePageList(params); this.formTabledata = res.entities || []; this.total = res.entityCount || 0; // 确保在DOM更新后执行选中操作 this.$nextTick(() => { this.setSelectedRows(); }); } catch (error) { console.error('加载边坡数据失败', error); this.$message.error('加载边坡数据失败'); } finally { this.loading = false; } }, // 分页大小变化 handleSizeChange(val) { this.pageParams.pageSize = val; this.pageParams.pageNo = 1; this.LoadListData(); }, // 当前页码变化 handleCurrentChange(val) { this.pageParams.pageNo = val; this.LoadListData(); }, // 获取技术状态等级选项 async getEvaluateLevel() { const levelList = await mapCfg("Inspection.Regular.RegularEvaluateLevel")(); this.evaluateLeveloptions = levelList.map((item) => ({ value: item.key, label: item.value, })); }, // 提交表单 async submitForm() { this.$refs.formRef.validate(async (valid) => { if (valid) { // 验证是否选择了边坡 if (this.allSelection.size === 0) { this.$message.warning("请至少选择一个边坡"); return; } // 构造提交参数 const params = { ...this.currentForm, sideSlopeDetailList: Array.from(this.allSelection.values()).map((item) => ({ sideSlopeUniqueCode: item.sideSlopeUniqueCode, evaluateLevel: item.evaluateLevel, evaluateDate: item.evaluateDate ? item.evaluateDate : undefined, })), }; // 根据模式选择操作 const action = this.dialogMode === "create" ? addPeriodicInspection : modifyPeriodicInspection; // 执行操作 try { const success = await action(params); if (success) { this.$message.success( this.dialogMode === "create" ? "新建成功" : "修改成功" ); this.$refs.scrollTable.clearSelection(); this.$emit("success"); this.dialogVisible = false; } else { this.$message.error("操作失败"); } } catch (error) { this.$message.error(error.message || "操作失败"); } } }); }, // 计算表格高度(自适应) calculateTableHeight() { this.$nextTick(() => { try { const dialogBody = document.querySelector( ".fixed-height-dialog .el-dialog__body" ); if (dialogBody) { const bodyHeight = dialogBody.clientHeight; const headerHeight = document.querySelector(".formBorder")?.offsetHeight || 0; const searchHeight = document.querySelector(".formBorder2 .el-header")?.offsetHeight || 0; const footerHeight = document.querySelector(".formBorder2 .el-footer")?.offsetHeight || 0; const padding = 30; // 安全边距 this.tableHeight = bodyHeight - headerHeight - searchHeight - footerHeight - padding; } } catch (e) { console.warn("高度计算错误", e); this.tableHeight = 300; // 默认高度 } }); }, }, }; </script> <style lang="scss" scoped> :deep(.fixed-height-dialog) { .el-dialog { display: flex; flex-direction: column; max-height: 80vh !important; height: 80vh !important; .el-dialog__body { flex: 1; overflow: hidden; padding: 15px 20px; display: flex; flex-direction: column; } } } // 项目信息区域样式 .formBorder { position: relative; border: thin dotted black; padding: 10px; flex-shrink: 0; &::before { content: "项目信息"; position: absolute; top: -10px; left: 40px; background-color: #fff; padding: 0 10px; font-size: 14px; color: #606266; } } // 待检边坡区域样式 .formBorder2 { margin-top: 15px; position: relative; border: thin dotted black; padding: 10px; flex: 1; min-height: 0; display: flex; flex-direction: column; &::before { content: "待检边坡"; position: absolute; top: -10px; left: 40px; background-color: #fff; padding: 0 10px; font-size: 14px; color: #606266; } } // 弹窗底部按钮区域 .dialog-footer { padding: 10px 20px; border-top: 1px solid #ebeef5; text-align: center; } // 搜索区域样式 .searchDialog { margin-top: 5px; } // 空数据样式 :deep(.el-table__empty-block) { min-height: 200px; display: flex; justify-content: center; align-items: center; } // 分页样式 :deep(.el-pagination) { padding: 5px 0; } </style> 为什么表格高度越来越高 我想要固定dialog高度
08-21
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值