将.match()过滤器转换为小写的Vue JS

时间:2018-09-24 15:22:17

标签: vue.js

我已经在Vue JS中创建了一个自定义搜索过滤器。它具有多个可过滤字段,并且我试图将用户键入的内容转换为小写形式的输入框,以保持一致。这是我的过滤器:

filteredProperties: function(){
      return this.properties.filter((property) => {
        return property.address.toLowerCase().match(this.searchAddress) && property.type.match(this.searchType) && property.bedrooms.match(this.searchBedrooms) && property.county.match(this.searchCounty)
      });
    } 

我需要将.match(this.searchAddress)转换为小写,使其与主地址部分匹配。

我尝试过:

.match(this.searchAddress).toLowerCase()

.match(this.searchAddress.toLowerCase())

0 个答案:

没有答案