Vue.js 中 slot-scope 的用法
slot-scope 属性允许在使用插槽时传递数据,从而在插槽内使用这些数据。它通过在插槽模板中创建作用域,以便访问插槽外的数据。
使用方法
<slot></slot> 元素上使用 slot-scope 属性,指定一个变量名来接收插槽外的数据。例如:
<code class="html"><slot name="header" slot-scope="headerData"><h1>{{ headerData.title }}</h1>
</slot></code>




