๐Ÿ“šย Reference


๐Ÿ“œย Chapter


Front-end ์„ฑ๋Šฅ ์ตœ์ ํ™”

Vue.js - ์„ฑ๋Šฅ ์ตœ์ ํ™”

โ€ฃ

Async Component


import { defineAsyncComponent } from 'vue'

const AsyncComp = defineAsyncComponent(() => {
  return new Promise((resolve, reject) => {
    // ...load component from server
    resolve(/* loaded component */)
  })
})
// ... use `AsyncComp` like a normal component
import { defineAsyncComponent } from 'vue'

const AsyncComp = defineAsyncComponent(() =>
  import('./components/MyComponent.vue')
)
app.component('MyComponent', defineAsyncComponent(() =>
  import('./components/MyComponent.vue')
))