ElementUI表格中新增表頭圖示懸浮提示
阿新 • • 發佈:2021-12-09
本文主要介紹了ElementUI表格中新增表頭圖示懸浮提示,分享給大家,具體如下:
<el-table-column label="操作" fixed="right" :render-header="tableAction" width="120"> <!--scope 即為 userList scope.row即為當前行資料 --> <template slot-scopehttp://www.cppcns.com="scope"> <el-button @click="editCar(scope.row)" type="primary" icon="el-icon-edit" size="small" circle></el-button> <el-button @click="delCar(scope.row.carId)" type="danger" 客棧 icon="el-icon-delete" circle size="small"></el-button> </template> </el-table-column>
//表格操作提示 tableAction() { return this.$createElement('HelpHint',{ props: { content: '編輯車輛 / 刪除車輛' } },'操作'); },
切記匯入
import HelpHint from ‘~/components/HelpHint/HelpHint.';
並在 components中引入
HelpHint.vue 元件內容
<template> <span> <span style="margin-right: 8px"><slot></slot></span> <el-tooltip :content="content" :placement="placement"> <i class="el-icon-question" style="cursor: pointer;"></i> </el-tooltip> </span> </template> <script> export default { name: 'HelpHint',props: { placement: { default: 'top' },content: String,},data() { return {} },} </script>
到此這篇關於ElementUI表格中新增表頭圖示懸浮提示的文章就介紹到這了,更多相關Element 圖示懸浮提示內容請搜尋我們以前的文章或繼續瀏覽下面的相關文章希望大家以後多多支援我們!