zhengyiming
2025-03-24 21b418f4ffb8e76d72819e8d489b3179154cb0c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<template>
  <div v-if="loading" class="loading-layout-loading-content-wrapper">
    <IconFont name="loading" />
    <div class="list-empty-hint-text">数据加载中......</div>
  </div>
  <Empty
    v-else-if="error"
    class="loading-layout-error-wrapper"
    status="error"
    description="加载失败"
  >
    <div :style="{ marginTop: '10px' }">
      <nut-button type="primary" @click="loadError"> 重试 </nut-button>
    </div>
  </Empty>
  <template v-else>
    <NoData v-if="showNoData" />
    <slot v-else></slot>
  </template>
</template>
 
<script setup lang="ts">
import { loadingLayoutProps } from './layout';
import { IconFont } from '@nutui/icons-vue-taro';
import NoData from '../NoData/NoData.vue';
import { Button as NutButton, Empty } from '@nutui/nutui-taro';
 
defineOptions({
  name: 'LoadingLayout',
});
 
const props = defineProps(loadingLayoutProps);
</script>