From cdd09ed9437cabb0381a5f1fb77ac187fc7cef1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E6=95=8F=E5=8D=8E?= <180657@gree.com.cn> Date: Fri, 15 Nov 2019 17:41:00 +0800 Subject: [PATCH] fix[TagsView]: fixed CachedView bug (PanJiaChen#406) --- src/store/modules/tagsView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 57e72421..12b8d1c6 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -15,7 +15,12 @@ const mutations = { ADD_CACHED_VIEW: (state, view) => { if (state.cachedViews.includes(view.name)) return if (!view.meta.noCache) { - state.cachedViews.push(view.name) + for (const matchedView of view.matched) { + const { name } = matchedView.components.default + if (name && state.cachedViews.indexOf(name) === -1) { + state.cachedViews.push(name) + } + } } },