Commit 60a7ab15 authored by wuhao's avatar wuhao :dart:

asder

parent b6ae7e46
......@@ -119,16 +119,19 @@ const TagView = ({ children, home }) => {
setTagList(tagsCopy);
};
const [refresh, setrefresh] = useState(true);
// 刷新选择的标签
const handleRefreshTag = (tag) => {
const tagsCopy = tagList.map((item) => {
if (item.path === tag.path) {
history.push({ pathname: tag?.path, query: tag?.query });
return { ...item, refresh: item.refresh + 1, active: true };
}
return { ...item, active: false };
});
setTagList(tagsCopy);
const handleRefreshTag = async (tag) => {
// const tagsCopy = tagList.map((item) => {
// if (item.path === tag.path) {
// history.push({ pathname: tag?.path, query: tag?.query });
// return { ...item, refresh: item.refresh + 1, active: true };
// }
// return { ...item, active: false };
// });
// setTagList(tagsCopy);
await setrefresh(false);
setrefresh(true);
};
return (
......@@ -162,7 +165,7 @@ const TagView = ({ children, home }) => {
style={{ width: '100%', height: '100%' }}
hideTracksWhenNotNeeded={true}
>
{children}
{refresh && children}
</Scrollbars>
</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