How to customize the content of ElTableColumn

php中世界最好的语言
Release: 2018-06-13 09:49:05
Original
5289 people have browsed it

This time I will show you how to customize the content of ElTableColumn, and what are the precautions for customizing the content of ElTableColumn. The following is a practical case, let's take a look.

The company has a new requirement. Click on the head of ElTableColumn to search. My colleagues have already made this function, but it is a bit inconvenient to use. I plan to encapsulate it into a component and learn about it.

ElTableColumn originally looked like this:

What it wants to do is like this:

I will put the code directly, it is too much to explain one after another.

Structure of the code:

Components

    import ElTableColumnPro from './ElTableColumnPro' ElTableColumnPro.install = function(Vue) { Vue.component(ElTableColumnPro.name, ElTableColumnPro); }; export default ElTableColumnPro;
Copy after login

Installation

import ElTableColumnPro from 'components/ElTableColumnPro/index' ... ... ... Vue.use(ElTableColumnPro)
Copy after login

Use

        
Copy after login