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>
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>