Browse Source

add news

master
sunfree 9 months ago
parent
commit
6aa00c365b
  1. 63
      src/components/blogs/HomePage.vue

63
src/components/blogs/HomePage.vue

@ -385,23 +385,21 @@ const handleScroll = () => {
};
const menuClick = ({ item }: { item: any }) => {
handleScrollEnabled.value=false
if (scrollbar.value) {
}
if (item.url=="/" || item.url=="/home") {
handleScrollEnabled.value=true
show_carousel.value=true
}else{
show_menu.value=true
show_carousel.value=false
scrollbar.value!.scrollTop=0
mainCss.marginTop="48px"
// localStorage.setItem('show_menu', 'true');
// localStorage.setItem('show_carousel', 'false');
// localStorage.setItem('scrollPosition', '0');
// localStorage.setItem('mainCss_marginTop', '48px');
}
router.push(item.url)
// handleScrollEnabled.value = false;
// if (scrollbar.value) {
// scrollbar.value.scrollTop = 0;
// }
// if (item.url === '/' || item.url === '/home') {
// handleScrollEnabled.value = true;
// show_carousel.value = true;
// } else {
// show_menu.value = true;
// show_carousel.value = false;
// mainCss.marginTop = '48px';
// }
router.push(item.url);
}
const current = ref<string[]>(['mail']);
@ -418,6 +416,7 @@ const downScroll = () => {
}, 300);
}
};
//
// const articles=reactive({
// img:"",
@ -437,6 +436,35 @@ const img = ref("https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png")
const gravatarClick = () => {
window.open("https://www.baidu.com")
}
const updateCarouselVisibility = (routeName) => {
handleScrollEnabled.value = false;
if (scrollbar.value) {
scrollbar.value.scrollTop = 0;
}
if (routeName === 'home') {
handleScrollEnabled.value = true;
show_carousel.value = true;
} else {
show_menu.value = true;
show_carousel.value = false;
mainCss.marginTop = '48px';
}
};
//
watch(
() => route.name,
(newRouteName) => {
updateCarouselVisibility(newRouteName);
},
{ immediate: true }
);
router.beforeEach((to, from, next) => {
updateCarouselVisibility(to.name);
next();
});
</script>
<style scoped>
.headerMenu {
@ -492,6 +520,7 @@ const gravatarClick = () => {
height: 100vh;
width: 100vw;
}
.anchorDown {
position: absolute;
bottom: 100px;

Loading…
Cancel
Save