vue根据数组

想实现个本地搜索?

慕哥9229398
浏览 526回答 1
1回答

慕标琳琳

你这个for循环有问题啊还有就是你的carditem是对象searlist是数组carditem=searlist??for (let keys in this.carditem){&nbsp; &nbsp; &nbsp; &nbsp; //console.log(this.carditem[keys])&nbsp; &nbsp; &nbsp; &nbsp; for (let i = 0; i < this.carditem[keys].length; i++) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(this.carditem[key][i].name == cur){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript