小工具知识网

当前位置: 首页 > 行业知识 > Vue3 使用动态组件 component

行业知识

Vue3 使用动态组件 component

2026-10-21 20:03:43 来源:互联网转载

component ���签:用于动态渲染标签或组件。

语法格式:

标签内容

动态渲染标签:

  

我是父组件

动态渲染 h1 标签

动态渲染组件:

  

我是父组件

切换组件
// 引入组件import A from '../components/A';import B from '../components/B';// 引入 ref 函数import { ref } from 'vue';const isShow = ref(true);

原创作者:吴小糖

创作时间:2024.2.29 

上一篇:ftp服务器缓存怎么清除?

下一篇:抖音为什么卡?