vue二次封装组件,继承原组件的所有属性及事件

 

 1 <template>
 2     <div
 3         v-bind="$attrs" 
 4         v-on="$listeners"
 5     >
 6       <template v-for="(index, name) in $slots" v-slot:[name]>
 7         <slot :name="name"/>
 8       </template>
 9     </div>
10 </template>

 

posted @ 2024-01-14 16:33  PromiseOne  阅读(292)  评论(0编辑  收藏  举报