This article example shares the specific code for implementing drop-down filtering in the element UI table for your reference. The specific content is as follows 1. In default-sort, prop passes in the field to be sorted (data returned by the interface or defined by yourself), and order represents the sorting, and descending order is used here <template> <el-table :data="tableData" style="width: 100%" empty-text="No data yet" ref="filterTable" > <el-table-column prop="deviceType" label="Device Type" show-overflow-tooltip column-key="deviceType" :filters="[ { text: 'Weather equipment', value: 1 }, { text: 'Emotional equipment', value: 0 }, ]" :filter-method="filterHandler" :filter-multiple="true" > <template slot-scope="scope"> <span v-if="scope.row.deviceType == 1">Weather monitoring equipment</span> <span v-if="scope.row.deviceType == 0">Collapse monitoring equipment</span> <span></span> </template> </el-table-column> </el-table> </template> methods: { // Header filtering event filterHandler(value, row, column) { const property = column["property"]; return row[property] === value; } } Data Types Page Effects The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: A permanent solution to MYSQL's inability to recognize Chinese
>>: Add ico mirror code to html (favicon.ico is placed in the root directory)
When doing a project, it is inevitable to encount...
[Problem description] On the application side, th...
As the Internet era becomes more mature, the deve...
Table of contents What is ref How to use ref Plac...
<br />We have always emphasized semantics in...
Copy code The code is as follows: <!DOCTYPE ht...
Table of contents Solution: 1. IGNORE 2. REPLACE ...
Before learning awk, we should have learned sed, ...
Preface Normally, if we want to delete certain li...
Table of contents 1. What is Javascript? 2. What ...
environment: 1. CentOS6.5 X64 2.mysql-5.6.34-linu...
Cell padding is the distance between the cell con...
The table creation command requires: The name of...
Preface: Because many business tables use design ...
This article uses examples to illustrate the prin...