40 lines
1011 B
Vue
40 lines
1011 B
Vue
|
||
<!-- z-paging自定义的下拉刷新view -->
|
||
<template>
|
||
<view class="refresher-container">
|
||
<image
|
||
class="refresher-image"
|
||
mode="aspectFit"
|
||
src="./images/refresher_loading.gif"
|
||
></image>
|
||
<text class="refresher-text">{{ statusText }}</text>
|
||
</view>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { computed } from "vue";
|
||
|
||
const props = defineProps({
|
||
status: {
|
||
type: String,
|
||
default: "",
|
||
},
|
||
});
|
||
|
||
const statusText = computed(() => {
|
||
// 这里可以做i18n国际化相关操作,可以通过uni.getLocale()获取当前语言(具体操作见i18n-demo.vue);
|
||
// 获取到当前语言之后,就可以自定义不同语言下的展示内容了
|
||
const statusTextMap = {
|
||
default: "哎呀,用点力继续下拉!",
|
||
"release-to-refresh": "拉疼我啦,松手刷新~~",
|
||
loading: "正在努力刷新中...",
|
||
complete: "刷新成功啦~",
|
||
};
|
||
return statusTextMap[this.status];
|
||
});
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
@import "./styles/index.scss";
|
||
</style>
|