includes用于搜索筛选关键字 后把数据重新渲染列表 searchs() { // 原数据清空 this.tableData = [] // 新数据循环 使用includes方法 在输入框查找username this.search.forEach(element => { if (element.username.includes(this.value)) { //把搜索到的数据 push 给当前渲染的数组 this.tableData.push(element) console.log(element) } }); },