element loading遮罩层添加按钮

html 复制代码
<el-table v-loading="loadingText" element-loading-text="拼命加载中" :data="tableData" :tableColumn="tableColumn" :span-method="objectSpanMethod" border :cell-style="cellStyle" :header-cell-style="{'text-align': 'center'}">
      <template v-slot:append>
        <el-button v-if="loadingText" type="primary" class="cancel-loading" @click="cancelLoading" size="mini">取消</el-button>
      </template>
      <el-table-column v-for="item in tableColumn" :key="item.prop" :prop="item.prop" :label="item.label" min-width="100" />
    </el-table>
javascript 复制代码
data() {
	return {
		loadingText: false,
	}
}


cancelLoading() {
      this.loadingText = false; 
    },
css 复制代码
.cancel-loading {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999; /* 确保 z-index 高于遮罩层 */
}
相关推荐
2分钟速写快排6 小时前
孔乙己的茴字有多少种写法?|AI 对话实时通信的三种实现
前端·javascript·github
Penge6668 小时前
JavaScript:BOM 详解
前端
Penge6669 小时前
Vite vs Webpack:前端构建工具原理与实战
前端
Penge6669 小时前
前端包管理工具:npm、Yarn、pnpm 快速入门
前端
Penge6669 小时前
Sass 了解
前端
Penge6669 小时前
Webpack 打包从 0 到 1 实战笔记
前端
Penge6669 小时前
Webpack 入门:是什么、为什么需要、怎么使用?
前端
Penge66610 小时前
Ant Design(Antd)了解
前端
wangruofeng10 小时前
同一行代码,百种渲染:Asuka、React Native 与 Flutter 跨平台渲染机制深度拆解
前端·github
Penge66610 小时前
JavaScript 核心语法速通
前端