skyblued 2 years ago
parent
commit
dc8dc02c7c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/views/courseList/index.tsx

+ 4 - 1
src/views/courseList/index.tsx

@@ -12,9 +12,11 @@ export default defineComponent({
     const route = useRoute()
     const route = useRoute()
     const router = useRouter()
     const router = useRouter()
     const data = reactive({
     const data = reactive({
+      loading: true,
       list: [] as any
       list: [] as any
     })
     })
     const getList = async () => {
     const getList = async () => {
+      data.loading = true
       if (route.query.courseScheduleId) {
       if (route.query.courseScheduleId) {
         try {
         try {
           const res: any = await request.post(
           const res: any = await request.post(
@@ -40,6 +42,7 @@ export default defineComponent({
           }
           }
         } catch (error) {}
         } catch (error) {}
       }
       }
+      data.loading = false
     }
     }
     onMounted(() => {
     onMounted(() => {
       getList()
       getList()
@@ -115,7 +118,7 @@ export default defineComponent({
             )
             )
           })}
           })}
         </Grid>
         </Grid>
-        {!data.list.length && <Empty description="空空如也" />}
+        {!data.loading && !data.list.length && <Empty description="空空如也" />}
         {/* <Button
         {/* <Button
           onClick={() => {
           onClick={() => {
             location.href =
             location.href =