在异步组件中使用全局组件

时间:2019-01-24 09:12:10

标签: vuejs2 vuetify.js

我已经使用Vue创建了一个异步组件。它已加载到服务器中的某个位置。我想在组件中使用一些全局组件,例如ui component [Vuetify],但浏览器表示未注册。谁能给我一些建议。

浏览器给我这个错误 未知的自定义元素:-您是否正确注册了组件?对于递归组件,请确保提供“名称”选项。

<template>
   <v-icon>home</v-icon>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
const RemoteComponent = new Promise(resolve => {
   // it is loaded from server
   resolve({
     template: '<v-icon>home</v-icon>'
   })
})
@Component({
   components: {
     RemoteComponent
   }
})
export default class LocalComponent extends Vue {}
</script>

有人可以帮助我吗?

0 个答案:

没有答案