vue 插槽slot 父组件为子组件传递html结构
app.vue
<template> <h1>插槽知识</h1> <SmallSlot> <div> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </div> </SmallSlot> </template> <script> import SmallSlot from './components/SmallSlot.vue' export default{ components:{ SmallSlot } } </script>SmallSlot.vue <template> <slot></slot> </template>
<script> export default { } </script> <style> </style> 标签:slot,vue,default,插槽,SmallSlot,export From: https://www.cnblogs.com/96net/p/18015971