_this2.search.toLowerCase is not a function

_this2.search.toLowerCase is not a function

项目中写了模糊搜索,但是点击地图上的icon时要显示这条数据,我想调用之前写的模糊搜索的方法让表格只显示当前数据,点击时让输入框变成搜索的id,不点击icon时,让输入框为空就又回到了之前的数据,但是报错了
_this2.search.toLowerCase is not a function

  • 先看之前代码
    _this2.search.toLowerCase is not a function
    这里就是数据没有办法使用toLowerCase方法。那么我们把数据转为String类型之后,再调用此方法。_this2.search.toLowerCase is not a function
    这样就可以了,看下效果,点击icon时_this2.search.toLowerCase is not a function
    不点击icon_this2.search.toLowerCase is not a function