This commit is contained in:
quantulr
2022-10-19 00:22:39 +08:00
parent e2da1fd45b
commit 88e3b00298
44 changed files with 1827 additions and 1324 deletions

View File

@ -49,7 +49,7 @@
</div>-->
</template>
<script setup lang="ts">
<script setup>
import {
reactive,
onMounted,
@ -67,7 +67,7 @@ import index6 from "./comp/index6.vue";
import index7 from "./comp/index7.vue";
import index8 from "./comp/index8.vue";
const loading = ref<boolean>(true);
const loading = ref(true);
setTimeout(() => {
loading.value = false;
}, 500);
@ -106,7 +106,7 @@ const pre = () => {
move(state.fullpage.current); // 执行切换
}
};
function move(index: number) {
function move(index) {
state.fullpage.isScrolling = true; // 为了防止滚动多页,需要通过一个变量来控制是否滚动
directToMove(index); //执行滚动
setTimeout(() => {
@ -114,10 +114,10 @@ function move(index: number) {
state.fullpage.isScrolling = false;
}, 1010);
}
function directToMove(index: number) {
function directToMove(index) {
let height = fullPageRef.value["clientHeight"]; //获取屏幕的宽度
// let scrollPage = proxy.$refs["fullPageContainer"]; // 获取执行tarnsform的元素
let scrollHeight: string; // 计算滚动的告诉,是往上滚还往下滚
let scrollHeight; // 计算滚动的告诉,是往上滚还往下滚
scrollHeight = -(index - 1) * height + "px";
fullPageContainerRef.value.style.transform = `translateY(${scrollHeight})`;
state.fullpage.current = index;
@ -167,11 +167,11 @@ let state = reactive({
zIndex: 1,
title: "index3",
},
{
comp: shallowRef(index4),
zIndex: 1,
title: "index4",
},
// {
// comp: shallowRef(index4),
// zIndex: 1,
// title: "index4",
// },
{
comp: shallowRef(index5),
zIndex: 1,
@ -200,7 +200,7 @@ let state = reactive({
});
// 点击 indicator 时
const handleIndicatorClick = (idx: number) => {
const handleIndicatorClick = (idx) => {
if (idx == state.fullpage.current) {
return;
} else if (idx > state.fullpage.current) {