fixbug
This commit is contained in:
parent
bce6823c18
commit
b3ae5b35ad
@ -23,7 +23,7 @@ function getBrowserLanguage() {
|
||||
}
|
||||
|
||||
// 获取存储的语言或浏览器语言
|
||||
const savedLanguage = 'en'
|
||||
const savedLanguage = localStorage.getItem('language') || getBrowserLanguage()
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false, // 使用 Composition API
|
||||
|
@ -100,7 +100,6 @@ const handlePrev = () => {
|
||||
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
|
||||
currentIndex.value--;
|
||||
|
||||
// 如果滑到第一组的开头,立即跳转到第二组对应位置
|
||||
if (currentIndex.value < 0) {
|
||||
currentIndex.value = state.marqueeArr.length - 1;
|
||||
}
|
||||
@ -113,7 +112,6 @@ const handleNext = () => {
|
||||
carouselTrack.value.style.transition = "transform 0.5s ease-in-out";
|
||||
currentIndex.value++;
|
||||
|
||||
// 如果滑到最后,立即跳转到第一个位置
|
||||
if (currentIndex.value >= state.marqueeArr.length) {
|
||||
currentIndex.value = 0;
|
||||
}
|
||||
@ -225,9 +223,7 @@ const carouselTrack = ref(null);
|
||||
const currentIndex = ref(0);
|
||||
|
||||
const getVisibleItems = () => {
|
||||
const items = state.marqueeArr;
|
||||
// 前后各复制一组,实现无缝循环
|
||||
return [...items, ...items];
|
||||
return state.marqueeArr;
|
||||
};
|
||||
|
||||
// 计算实际滑动距离
|
||||
|
@ -650,11 +650,11 @@ watch(
|
||||
</section>
|
||||
|
||||
<section className="panel" style="background-color: #F8F9FF;">
|
||||
<n-divider class="divider1" vertical />
|
||||
<div class="divider2" style=""></div>
|
||||
<div class="divider3" style=""></div>
|
||||
<div class="divider4" style=""></div>
|
||||
<n-divider class="divider5" vertical />
|
||||
<n-divider class="divider1" vertical style="height: 100%;" />
|
||||
<div class="divider2" style="height: 100%;"></div>
|
||||
<div class="divider3" style="height: 100%;"></div>
|
||||
<div class="divider4" style="height: 100%;"></div>
|
||||
<n-divider class="divider5" vertical style="height: 100%;" />
|
||||
<div class="parallax-bg"></div>
|
||||
<div class="content4 mt-[103px]">
|
||||
<div class="text-[#8B59F7] text-[16px]">{{ t('home.section4.label') }}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user