Commit 60a7ab15 authored by wuhao's avatar wuhao 🎯

asder

parent b6ae7e46
...@@ -119,16 +119,19 @@ const TagView = ({ children, home }) => { ...@@ -119,16 +119,19 @@ const TagView = ({ children, home }) => {
setTagList(tagsCopy); setTagList(tagsCopy);
}; };
const [refresh, setrefresh] = useState(true);
// 刷新选择的标签 // 刷新选择的标签
const handleRefreshTag = (tag) => { const handleRefreshTag = async (tag) => {
const tagsCopy = tagList.map((item) => { // const tagsCopy = tagList.map((item) => {
if (item.path === tag.path) { // if (item.path === tag.path) {
history.push({ pathname: tag?.path, query: tag?.query }); // history.push({ pathname: tag?.path, query: tag?.query });
return { ...item, refresh: item.refresh + 1, active: true }; // return { ...item, refresh: item.refresh + 1, active: true };
} // }
return { ...item, active: false }; // return { ...item, active: false };
}); // });
setTagList(tagsCopy); // setTagList(tagsCopy);
await setrefresh(false);
setrefresh(true);
}; };
return ( return (
...@@ -162,7 +165,7 @@ const TagView = ({ children, home }) => { ...@@ -162,7 +165,7 @@ const TagView = ({ children, home }) => {
style={{ width: '100%', height: '100%' }} style={{ width: '100%', height: '100%' }}
hideTracksWhenNotNeeded={true} hideTracksWhenNotNeeded={true}
> >
{children} {refresh && children}
</Scrollbars> </Scrollbars>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment