current position:Home>Vue + element implements table filtering
Vue + element implements table filtering
2022-04-29 06:32:45【We long for a different world】
install Vue and el I won't say anything , Also roast style ugly , The author is too lazy to write style mainly to show the writing method and function, although I want to roast about it myself
<template>
<div style="margin-top: 150px;">
<div>Vue Table filtering </div>
<el-row :gutter="20" style="margin-bottom:35px;" type="flex" justify="space-between">
<el-col :span="8">
<el-input placeholder=" Please enter a name " v-model="input1" class="input-with-select" @change="getvalue1">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-col>
<el-col :span="8">
<el-input placeholder=" Please enter the province " v-model="input2" class="input-with-select" @change="getvalue2">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-col>
<el-col :span="8">
<el-input placeholder=" Please enter email address " v-model="input3" class="input-with-select" @change="getvalue3">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-col>
</el-row>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
fixed
prop="date"
label=" date "
width="150">
</el-table-column>
<el-table-column
prop="name"
label=" full name "
width="120">
</el-table-column>
<el-table-column
prop="province"
label=" Province "
width="120">
</el-table-column>
<el-table-column
prop="city"
label=" The city "
width="120">
</el-table-column>
<el-table-column
prop="address"
label=" Address "
width="300">
</el-table-column>
<el-table-column
prop="zip"
label=" Zip code "
width="120">
</el-table-column>
<el-table-column
fixed="right"
label=" operation "
width="100">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small"> Delete </el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
min} from '../min.js'
export default {
name: 'app_download',
mixins: [min],
data() {
return {
input1: '',
input2: '',
input3: '',
tableData: [{
date: '2016-05-02',
name: ' X.h. ',
province: ' Haojing ',
city: ' Putuo District ',
address: ' 1518 get ',
zip: 5435
}, {
date: '2016-05-04',
name: ' Wang lei ',
province: ' tianjin ',
city: ' Putuo District ',
address: ' Putuo District, Shanghai 3432432 Jinshajiang Road 1517 get ',
zip: 200213333
}, {
date: '2016-05-01',
name: ' Wang dada ',
province: ' Beijing ',
city: ' Putuo District ',
address: ' Shanghai Pu 34324 Jinshajiang Road, Tuo District 1519 get ',
zip: 2132
}, {
date: '2016-05-03',
name: ' Faye Wong ',
province: ' nanjing ',
city: ' Putuo District ',
address: ' Putuo District, Shanghai 242433 Jinshajiang Road 1516 get ',
zip: 213
}]
}
},
methods: {
getvalue1(){
const data=this.tableData
data.forEach((item,index)=>{
if(item.name==this.input1){
this.tableData=data.splice(index,1)
}
})
this.input1=''
},
getvalue2(){
const data=this.tableData
data.forEach((item,index)=>{
if(item.province==this.input2){
this.tableData=data.splice(index,1)
}
})
this.input2=''
},
getvalue3(){
const data=this.tableData
data.forEach((item,index)=>{
if(item.zip==this.input3){
this.tableData=data.splice(index,1)
}
})
this.input3=''
},
handleClick(row) {
console.log(row);
}
},
created() {
console.log(min)
},
mounted() {
},
}
</script>
copyright notice
author[We long for a different world],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204260938537965.html
The sidebar is recommended
- Singleton mode - front end design mode
- QT sets that child elements do not inherit the parent style
- Using react to realize comment function
- Front end Vue template
- Front end vuejs set sail
- Front end Vue data binding and MVVM
- Vue data proxy and hijacking in front end
- Vue style of front end
- Front end Vue event handling
- Principle of Vue monitoring data change in front end
guess what you like
Vue calculation attribute and monitoring attribute of the front end
Front end Vue conditional rendering and list rendering
The front-end Vue collects form data
Vue built-in instruction of front end
Unknown HttpClient factory netty at org. openqa. selenium. remote...
Where is the user information obtained by the front end
What is the gutter principle of Ant Design Vue a-row
Element form account password
CSS to add horizontal lines around the text
Solution to vscode Vue project always reporting space or semicolon warning
Random recommended
- [entry DIARY 7 - ref of react]
- React - higher order functions and controlled components
- Calling setcookie in Ajax fails without any error in the IDE
- Differences, advantages and disadvantages between Ajax and Axios
- Choose Java or front-end for training and learning
- Simple sorting of JavaScript deep copy and shallow copy
- Analysis of event loop mechanism in JavaScript
- Epidemic prevention and control system of front and rear end separation based on Vue + nodejs
- Implementation of enterprise personnel management system by separating the front and back ends of springboot + Vue
- Vue difference between two arrays
- Vue openlayer add wind farm effect
- How to get child nodes of elements in HTML
- The file code with HTML suffix of vscode is not highlighted
- Use the table in Vue element admin in Vue admin template?
- [JavaScript] convert numerical value to numerical value
- Differences, advantages and disadvantages between Ajax and Axios
- Quietly tell you: the wrong place in react18 document
- The new smart spirit 1 starts in Asia! Breaking 100 in 6.7 seconds + frameless door, 190000 pre-sale
- Analysis of event loop mechanism in JavaScript
- Error occurred when installing vant on webstorm
- With the blessing of tinnove system, Changan uni-v does not have its own table
- Judging the application direction of small flat wire motor from SM 4x4 driverless technology verification vehicle
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- React bread crumbs
- HTTP network protocol
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Vue3 + nuxt3 build SSR website application, and realize server-side rendering from 0 to 1 without secret Fen sharing
- Use of vuex
- Element UI El table modify input value view not updated
- Getsnapshotbeforeupdate example of react
- Recently, the MySQL server on the cloud was hacked. It took 20 minutes to modify the password after being mercilessly encrypted. This time I'll be hacked with your last name
- Java project: sporting goods Mall (java + springboot + jsp + HTML + Maven + MySQL)
- Java project: shared study room reservation management system (java + springboot + thymeleaf + HTML + Maven + MySQL)
- Java project: sporting goods Mall (java + springboot + jsp + HTML + Maven + MySQL)
- Java project: shared study room reservation management system (java + springboot + thymeleaf + HTML + Maven + MySQL)
- Sennheiser momentum true wireless 3 true wireless headphones will be available on May 10
- Coffeescript 2.7.0 release, JavaScript translation language
- Im instant messaging development: load balancing of high-performance HTTP server