Add a floating prompt for the header icon in the ElementUI table

Add a floating prompt for the header icon in the ElementUI table

This article mainly introduces how to add floating prompts to header icons in ElementUI tables, and shares them with you. The details are as follows:

insert image description here

<el-table-column
    label="operation"
    fixed="right"
    :render-header="tableAction"
    width="120">
    <!--scope is userList scope.row is the current row data-->
    <template slot-scope="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>
 //Table operation prompt tableAction() {
     return this.$createElement('HelpHint', {
         props: {
             content: 'Edit vehicle/Delete vehicle'
         }
     }, 'operate');
 },

Remember to import

import HelpHint from '~/components/HelpHint/HelpHint.vue';

And introduce it in components

HelpHint.vue component content

<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>

This is the end of this article about adding header icon floating prompts in ElementUI tables. For more relevant Element icon floating prompts, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Use vue2+elementui for hover prompts
  • vue element ui validate actively triggers error prompt operation
  • Example of using Element Tooltip text prompt
  • Vue implements the header information prompt function in the element table (recommended)
  • Element combined with Vue to solve the problem of error prompt when there is value in form validation

<<:  SQL to implement time series dislocation restoration case

>>:  CSS3 realizes bouncing ball animation

Recommend

NULL and Empty String in Mysql

I recently came into contact with MySQL. Yesterda...

Solution to "No input file specified" in nginx+php

Today, the error "No input file specified&qu...

Vue implements the method of displaying percentage of echart pie chart legend

This article mainly introduces the pie chart data...

Django+mysql configuration and simple operation database example code

Step 1: Download the mysql driver cmd enters the ...

A brief discussion on the implementation principle of Webpack4 plugins

Table of contents Preface know Practice makes per...

HTML table tag tutorial (12): border style attribute FRAME

Use the FRAME property to control the style type ...

Use of Linux dynamic link library

Compared with ordinary programs, dynamic link lib...

Javascript File and Blob Detailed Explanation

Table of contents File() grammar parameter Exampl...

Build Tomcat9 cluster through Nginx and realize session sharing

Use Nginx to build Tomcat9 cluster and Redis to r...

Implementation code for using mongodb database in Docker

Get the mongo image sudo docker pull mongo Run th...

27 Linux document editing commands worth collecting

Linux col command The Linux col command is used t...

MySQL character set viewing and modification tutorial

1. Check the character set 1. Check the MYSQL dat...

Configuring MySQL and Squel Pro on Mac

In response to the popularity of nodejs, we have ...