Html 当我有干扰元素时,如何正确过滤vue.js列表

Html 当我有干扰元素时,如何正确过滤vue.js列表,html,vue.js,search,Html,Vue.js,Search,我在查找vue列表中的元素时遇到了问题,让我更好地解释一下,我有一个列表,其中列出了我国的地区、省和市,当我搜索地区时,我必须查看该地区的地区和省,当我查找省时,我必须查看该省的省和市,问题是有些市的省名中有一部分,因此在我插入搜索字段(ricerca)的列表中,也会显示非固有的省我使用它来过滤搜索,其中包含相关区域和省的名称以及相关市政当局和省的名称 Vue代码:(该列表仅为使结构易于理解的摘录) var anagraficanew=新的Vue({ el:“#内容"重新汇总”, 数据:{ se

我在查找vue列表中的元素时遇到了问题,让我更好地解释一下,我有一个列表,其中列出了我国的地区、省和市,当我搜索地区时,我必须查看该地区的地区和省,当我查找省时,我必须查看该省的省和市,问题是有些市的省名中有一部分,因此在我插入搜索字段(ricerca)的列表中,也会显示非固有的省我使用它来过滤搜索,其中包含相关区域和省的名称以及相关市政当局和省的名称

Vue代码:(该列表仅为使结构易于理解的摘录)

var anagraficanew=新的Vue({
el:“#内容"重新汇总”,
数据:{
searchQuery:null,
资源:[id:“2023”,“sigla:“CE”,“vista:“BAIA E LATINA”,“id_regione:”,“provincia:“Caserta”,“regione:”,“ricerca:“BAIA E LATINA Caserta”},{id:“3360”,“sigla:“FR”,“vista:“VILLA LATINA”,“id_regione:”,“provincia:“Frosinone”,“regione:”ricerca:“VILLA:“VILLA LATINA Frosinone:“Frosinone”},{”id:“3748”,“sigla:“LE”,“vista:“GALATINA:“GALATINA:“id"”,“省”:“莱切”、“雷吉翁”:“里塞卡”:“加拉蒂娜·莱切”},{“id”:“3896”、“西格拉”:“LT”、“维斯塔”:“APRILIA”、“id_regione”:“省”:“Latina”、“regione”:“里塞卡”:“APRILIA Latina”},{“id”:“3897”、“西格拉”:“LT”、“维斯塔”:“BASSIANO”、“id_regione”:“省”:“Latina”、“雷吉翁”:“丽卡”:“BASSIANO Latina”{“3898”、“西格拉”:“LT”、“维斯塔”CAMPODIMELE,id_regione:“provincia:“Latina”,“regione:”ricerca:”CAMPODIMELE Latina“},{“id:”3899”,“sigla:”LT”,“vista:”CASTELFORTE”,“id_regione:”provincia:”Latina”,“regione:”ricerca:”CASTELFORTE Latina“},{“id:”39”,“sigla:”LT”,“vista:”Latina”,“id_regione:”15”,“provincia:”Latina”,“regione:”LAZIO”,“ricerca:”Latina:”Latina“}“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、“拉丁美洲水池”、““利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利蒂亚”;“利塞卡”;“利塞卡”;“利塞卡”;“利蒂亚”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利蒂亚”;“利蒂卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“利塞卡”;“,“区域”:“区域”:“ricerca”:“ITRI Latina”},{“id”:“3906”,“sigla”:“LT”,“vista”:“Latina”,“id_regione”:“provincia”:“Latina”,“regione”:“ricerca”:“Latina Latina”},]
},
挂载:函数(){
},
计算:{
结果查询(){
if(this.searchQuery&&this.searchQuery.length>2){
返回此.resources.filter((项)=>{
返回此.searchQuery.toLowerCase().split(“”).every(v=>item.ricerca.toLowerCase().includes(v))
})  
}否则{
//归还此资源;
}
}
}
}),
}
html代码:

 <div class="wrapper" id="content_anagraficanew">
<div class="modal fade" id="modaleTabella" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">  
    <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Aggiungi zone</h5>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">                
                
              <div class="panel panel-default">
   <div class="panel-heading">
         <strong> All Resources</strong></div>
            <div class="row">
                 <div class="search-wrapper panel-heading col-sm-12">
                     <input class="form-control" type="text" v-model="searchQuery" placeholder="Search" />                   
                </div>                        
            </div>
        <div class="table-responsive" style="max-height: 300px; overflow-y: scroll;">
            <table v-if="resources.length" class="table">
                <thead>
                    <tr>
                         <th>Resource</th>
                    </tr>
                </thead>
                <tbody>
                 <tr v-if="resources.length" v-for="item in resultQuery">
                  
                  <td>{{item.provincia}}</td>
                  <td>{{item.sigla}}</td>
                  <td>{{item.regione}}</td>
                    <td> <a  href="#" v-on:click="add_zona(item.regione,item.provincia,'',item.sigla)" >
                     <i class="fas fa-plus"></i></a></td>
                    </tr>
                </tbody>
            </table>
        </div>
 
               
          </div>
                </div>
               
      <div class="modal-footer">
        
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
         
      </div>
    </div>
  </div>
</div>
</div>

阿吉翁吉区
&时代;
所有资源
资源
{{item.provincia}}
{{item.sigla}}
{{item.regione}
接近
是否有一种解决方案允许我不显示不相关的内容

谢谢

 <div class="wrapper" id="content_anagraficanew">
<div class="modal fade" id="modaleTabella" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">  
    <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Aggiungi zone</h5>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">                
                
              <div class="panel panel-default">
   <div class="panel-heading">
         <strong> All Resources</strong></div>
            <div class="row">
                 <div class="search-wrapper panel-heading col-sm-12">
                     <input class="form-control" type="text" v-model="searchQuery" placeholder="Search" />                   
                </div>                        
            </div>
        <div class="table-responsive" style="max-height: 300px; overflow-y: scroll;">
            <table v-if="resources.length" class="table">
                <thead>
                    <tr>
                         <th>Resource</th>
                    </tr>
                </thead>
                <tbody>
                 <tr v-if="resources.length" v-for="item in resultQuery">
                  
                  <td>{{item.provincia}}</td>
                  <td>{{item.sigla}}</td>
                  <td>{{item.regione}}</td>
                    <td> <a  href="#" v-on:click="add_zona(item.regione,item.provincia,'',item.sigla)" >
                     <i class="fas fa-plus"></i></a></td>
                    </tr>
                </tbody>
            </table>
        </div>
 
               
          </div>
                </div>
               
      <div class="modal-footer">
        
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
         
      </div>
    </div>
  </div>
</div>
</div>