vuejs2如何做到点击搜索进行多条件过滤匹配?需要具体代码。急
列表数据以及从json中获取出来了。
<template>
<div class="mainVip">
<div class="queryVip">
<div class="queryTitle">查询条件</div>
<div class="row">
<div class="col-lg-4 list_td">
源:<input type="text" class="form-control" v-model="sourceIp">
</div>
<div class="col-lg-4 list_td">
目标:<input type="text" class="form-control" v-model="destIp">
</div>
<div class="col-lg-4 list_td">
端口:<input type="text" class="form-control" v-model="sourcePort">
</div>
</div>
<button type="button" class="btn btn-primary" v-on:click="query">开始查询</button>
</div>
<div class="allVip">
<div class="queryTitle">全部数据</div>
<div class="tablelist" >
<table class="table table-striped table-bordered" id="datatable" style="min-width:2000px;margin-bottom: 0;">
<thead>
<tr>
<th width="10%">ID</th>
<th width="10%">源</th>
<th width="10%">源NatIP</th>
<th width="10%">目标</th>
<th width="10%">端口</th>
<th width="10%">起始时间</th>
<th width="10%">终止时间</th>
<th width="10%">创建时间</th>
</tr>
</thead>
<tbody>
<tr v-for="value in libraryInfo" >
<td>{{value.id}}</td>
<td>{{value.sourceIp}}</td>
<td>{{value.sourceNatIp}}</td>
<td>{{value.destIp}}</td>
<td>{{value.sourcePort}}</td>
<td>{{value.startTime}}</td>
<td>{{value.endTime}}</td>
<td>{{value.createTime}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>
<script>
data (){
return {
libraryInfo: [],
sourceIp:'',
destIp:'',
sourcePort:''
}
},
created() {
let urlApi = '../../static/data.json'
axios.get(urlApi).then((response) => {
let jsonData = response.data
this.libraryInfo = jsonData['data']
}, (response) => {
})
},
methods:{
query(){
//查询按钮
}
}
</script>
<template>
<div class="mainVip">
<div class="queryVip">
<div class="queryTitle">查询条件</div>
<div class="row">
<div class="col-lg-4 list_td">
源:<input type="text" class="form-control" v-model="sourceIp">
</div>
<div class="col-lg-4 list_td">
目标:<input type="text" class="form-control" v-model="destIp">
</div>
<div class="col-lg-4 list_td">
端口:<input type="text" class="form-control" v-model="sourcePort">
</div>
</div>
<button type="button" class="btn btn-primary" v-on:click="query">开始查询</button>
</div>
<div class="allVip">
<div class="queryTitle">全部数据</div>
<div class="tablelist" >
<table class="table table-striped table-bordered" id="datatable" style="min-width:2000px;margin-bottom: 0;">
<thead>
<tr>
<th width="10%">ID</th>
<th width="10%">源</th>
<th width="10%">源NatIP</th>
<th width="10%">目标</th>
<th width="10%">端口</th>
<th width="10%">起始时间</th>
<th width="10%">终止时间</th>
<th width="10%">创建时间</th>
</tr>
</thead>
<tbody>
<tr v-for="value in libraryInfo" >
<td>{{value.id}}</td>
<td>{{value.sourceIp}}</td>
<td>{{value.sourceNatIp}}</td>
<td>{{value.destIp}}</td>
<td>{{value.sourcePort}}</td>
<td>{{value.startTime}}</td>
<td>{{value.endTime}}</td>
<td>{{value.createTime}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>
<script>
data (){
return {
libraryInfo: [],
sourceIp:'',
destIp:'',
sourcePort:''
}
},
created() {
let urlApi = '../../static/data.json'
axios.get(urlApi).then((response) => {
let jsonData = response.data
this.libraryInfo = jsonData['data']
}, (response) => {
})
},
methods:{
query(){
//查询按钮
}
}
</script>
...全文
相关推荐
vue实现多条件和模糊搜索功能
### 代码实现文章提供了一个具体的Vue组件示例代码,该组件实现了一个简单的多条件和模糊搜索功能。具体实现如下:- `data`方法返回一个包含表单数据和数据列表的对象。
vue2.0多条件搜索组件使用详解
今天,我们将深入探讨Vue 2.0中的一个实用组件——多条件搜索组件,以及如何高效实现和使用它。### 概述Vue 2.0多条件搜索组件是一种允许用户根据多个不同的条件进行搜索的界面组件。
基于Vuejs的搜索匹配功能实现方法
从提供的内容看,应有一个方法`orderFn`来处理排序的点击事件,但并未展示搜索匹配的具体实现代码。4. **事件处理**:Vue中的事件处理是通过指令`v-on`或其简写`@`来实现的。
Vue.js实现多条件筛选、搜索、排序及分页的表格功能
综上所述,通过Vue.js实现多条件筛选、搜索、排序及分页的表格功能,涉及到组件设计、数据绑定、条件判断、数据处理等多个方面。
vue实现全匹配搜索列表内容
在Vue.js中实现全匹配搜索列表内容是一项常见的需求,它能够帮助用户快速定位到符合特定条件的数据。


