Files
2023-11-17 20:55:32 +08:00

77 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
@name: index
@author: kahu4
@date: 2023-11-06 18:08
@descriptionindex
@update: 2023-11-06 18:08
-->
<script setup>
import { toRefs } from "vue";
const props = defineProps({
text: {
type: String,
default: () => '加载中...'
},
showLine :{
type: Boolean,
default:true
}
})
const {text} = toRefs(props)
</script>
<template>
<view class="load-over flex flex-ai__center flex-jc__center">
<view class="line" v-if="showLine"></view>
<view class="text-box flex flex-ai__center flex-jc__center">
<view
:class="{text:true}"
:style="{animationDelay: `${index*0.2}s`}"
v-for="(item,index) in text"
:key="index"
>
{{ item }}
</view>
</view>
<view class="line" v-if="showLine"></view>
</view>
</template>
<style
scoped
lang="scss"
>
.load-over {
position: relative;
color: $tips-color;
.line {
width: 130rpx;
height: 2rpx;
border-radius: 2rpx;
background: $tips-color;
}
.text-box {
@include usePadding(30, 20);
.text {
@include usePadding(5, 0);
animation: jump 3s ease-in-out infinite;
}
}
}
@keyframes jump {
0%, 60% {
transform: translateY(0);
}
20% {
transform: translateY(-15rpx);
}
40% {
transform: translateY(15rpx);
}
}
</style>