Nuxt/test/fixtures/ssr/pages/asyncComponent.vue

18 lines
307 B
Vue
Raw Normal View History

2017-07-03 18:29:38 +00:00
<template>
<div>
<async-test/>
</div>
</template>
<script>
export default {
async asyncData({ error }) {
try {
this.components.AsyncTest = await import(`@/components/test.vue`)
} catch (e) {
error({ statusCode: 404, message: 'Can not load test component' })
}
}
}
</script>