vue3+ts 异步组件的使用

<template lang="html">
  <div>
    <Suspense>
      <template #default>
        <div><SyncVue></SyncVue></div>
      </template>
      <template #fallback>
        <skeleton></skeleton>
      </template>
    </Suspense>
  </div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineAsyncComponent } from "vue";
import skeleton from "./components/skeleton/skeleton.vue";
const SyncVue = defineAsyncComponent(
  () => import("./components/skeleton/sync.vue")
);
</script>
<style lang="scss"></style>

你可能感兴趣的:(java,javascript,前端)