|
|
@ -51,7 +51,7 @@ import { reactive, ref, nextTick, toRefs, onMounted } from 'vue'; |
|
|
|
import { DownCircleOutlined } from '@ant-design/icons-vue'; |
|
|
|
import Typed from 'typed.js'; |
|
|
|
import 'APlayer/dist/APlayer.min.css'; |
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
import ComLink from './leftsite/ComLink.vue'; |
|
|
|
import LeftSiteInfo from "./leftsite/LeftSiteInfo.vue" |
|
|
|
import StatisticCount from "./rightsite/StatisticCount.vue" |
|
|
@ -67,6 +67,13 @@ import FooterContent from './footer/FooterContent.vue'; |
|
|
|
import CataloGue from './leftsite/CataloGue.vue'; |
|
|
|
const router = useRouter() |
|
|
|
|
|
|
|
// onMounted(() => { |
|
|
|
// // 页面加载时绑定事件 |
|
|
|
// // window.addEventListener('beforeunload', handleRefresh); |
|
|
|
// handleRefresh() |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
const author = ref("SunFree.") |
|
|
|
const { idShow } = homePageStore() |
|
|
|
const { show_menu, show_carousel, show_author, show_anchornDown } = toRefs(idShow) |
|
|
@ -90,9 +97,9 @@ const updateCarouselVisibility = (routeName: any) => { |
|
|
|
const mainCss = reactive({ |
|
|
|
marginTop: "0px" |
|
|
|
}) |
|
|
|
const store = useContentStore(); |
|
|
|
router.beforeEach((to, _, next) => { |
|
|
|
updateCarouselVisibility(to.name); |
|
|
|
const store = useContentStore(); |
|
|
|
if (to.name === 'diarydetail' || to.name === 'blogdetail') { |
|
|
|
store.showCatalogue=true; |
|
|
|
} else { |
|
|
@ -101,6 +108,16 @@ router.beforeEach((to, _, next) => { |
|
|
|
next(); |
|
|
|
}); |
|
|
|
|
|
|
|
const handleRefresh = () => { |
|
|
|
const route=useRoute() |
|
|
|
if (route.name === 'diarydetail' || route.name === 'blogdetail') { |
|
|
|
store.showCatalogue=true; |
|
|
|
} else { |
|
|
|
store.showCatalogue=false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 滚动条操作 |
|
|
|
*/ |
|
|
@ -157,6 +174,7 @@ onMounted(() => { |
|
|
|
}; |
|
|
|
}); |
|
|
|
scrollbar.value = document.querySelector('.simplebar-content-wrapper'); |
|
|
|
handleRefresh() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |
|
|
|