问题:为什么vue3需要对引入的组件使用markrow?
系统共有:常规管理,公告管理,新闻管理,产品管理,采购订单管理,留言反馈管理,短信管理,用户管理,管理员管理,在线邮件管理,系统模板管理,图品缩略图及水印管理,Flash幻灯片管理,统计调查管理,系统数据调用管理,自定义扩展管理,语言标签库管理。18个主要功能模块组成。5月10号更新:1、全新双语模式设计开发2、多级动态JS菜单,支持在线添加,修改,删除3、新增单页管理模块,如扩展企业简介,联系方
0
<template>
<div>
<component :is="A"></component>
</div>
</template>
<script>
import A from './A';
export default {
name: 'Home',
data() {
return {}
},
components: { A },
}<template>
<ul>
<li
v-for='(item,index) in tabList'
:key='index'
@click='change(index)'
>
{{ item.name }}
</li>
</ul>
<keep-alive>
<component :is="currentComponent"></component>
</keep-alive>
</template>
<script setup>
import A from '../components/A.vue'
import B from '../components/B.vue'
import C from '../components/C.vue'
let tabList = reactive([
{name:'组件A',com:markRaw(A)},
{name:'组件B',com:markRaw(B)},
{name:'组件C',com:markRaw(C)}
]);
let currentComponent = reactive({
com:tabList[0]
});
const change = ( idx )=>{
currentComponent = tabList[idx].com;
}以上就是vue3动态组件如何使用的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号