Vue3中的透传Attributes / $attrs:简化组件开发的利器
<template>
<div>
<component :is="dynamicComponent" v-bind="$attrs" />
</div>
</template>
<script setup>
const dynamicComponent = 'ChildComponent';
Vue3中的透传Attributes / $attrs:简化组件开发的利器
<template>
<div>
<component :is="dynamicComponent" v-bind="$attrs" />
</div>
</template>
<script setup>
const dynamicComponent = 'ChildComponent';
大甜甜阅读 682
xiaoyan2017赞 1阅读 10.6k评论 1
xiaoyan2017赞 2阅读 10.5k评论 4
水冗水孚阅读 5.6k
苏琢玉赞 2阅读 577
xiaoyan2017赞 2阅读 761评论 1
mirahs赞 1阅读 511
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。