diff --git a/pkg_product/views/heritage/index.vue b/pkg_product/views/heritage/index.vue index 1e6bf8b..ca2fc5c 100644 --- a/pkg_product/views/heritage/index.vue +++ b/pkg_product/views/heritage/index.vue @@ -102,7 +102,8 @@ export default { contents: [], recommendList: [], keyword: '', - categoryId: '' + categoryId: '', + cacheList: [] } }, onLoad(opts) { @@ -112,11 +113,13 @@ export default { methods: { searchClick() { this.getRecommend() + this.contents = this.cacheList.filter(e => e.name.indexOf(this.keyword) > -1) }, getIchData() { getIch(this.id).then(res => { this.ichData = res.data - this.contents = res.data.categories[0] && res.data.categories[0].contents || [] + this.cacheList = res.data.categories[0] && res.data.categories[0].contents || [] + this.contents = this.cacheList this.categoryId = res.data.categories[0].ichCategoryId this.getRecommend() }) @@ -133,7 +136,8 @@ export default { }, handleTab(index, item) { this.actived = index - this.contents = item.contents + this.cacheList = item.contents + this.contents = this.cacheList this.categoryId = item.ichCategoryId this.getRecommend() },