Vue 3 中的Error Element Plus Dynamic Tab 组件

问题描述 投票:0回答:1
vue.js vuejs3 vue-component element-plus
1个回答
0
投票

如何使用动态组件在文档中: https://vuejs.org/guide/essentials/component-basics.html#dynamic-components

传递给

:is
的值可以包含:

  • 已注册组件的名称字符串,或者
  • 实际导入的组件对象

因此,例如,您的 tabName 对象之一应该是:

{
  desc: 'បន្ទប់',
  name: 'Grad Section',
  content: GradSection
}

其中

GradeSection
来自导入声明。

我应该注意到你的进口声明并不典型。它的写法就好像 GradSection.vue 有一个命名的导出。通常,组件会导出为默认导出,特别是当您使用

<script setup>
时。因此,除非您知道自己正在做一些非典型的事情,否则导入声明应该是

import GradSection from '~/components/setting/GradSection.vue'
© www.soinside.com 2019 - 2024. All rights reserved.