我已经创建了一个简单的Button
组件,实现如下:
<Button @click="clickEvent">Download Item</Button>`
这是我的按钮的模板.我使用<slot>
中的内容来呈现其文本:
<div class="customButton">
<slot></slot>
</div>
但是,我需要将槽内容第二次添加到屏幕阅读器的aria-label
属性中:
<div class="customButton" role="button" :aria-label="howDoIaccessSlotContent">
<slot></slot>
</div>
我如何访问这<slot>
个数据?Vue有没有一个特殊的this.$xxx
属性,我可以在其中访问JavaScript中的插槽信息?