我是一名相对较新的Vue开发人员。 在我们的代码库中,无论我去哪个领域,都会看到组件中有类似下面这样的代码:
<template #item.active="{ value }">
<div :aria-label="String(value)" class="text-center">
<v-icon v-if="value === null">mdi-minus</v-icon>
<v-icon v-else color="red">mdi-close</v-icon>
</div>
</template>
我真的想不出来
#item.active
(特别是#
)实际上起到了什么作用。我们有很多哈希项,比如<template #item.actions-prepend="{item}">
或<template #toolbar-extension>
。在谷歌上搜索#不是一件容易的事情。 显然我在Vue教程中错过了这个特定的视频! 我们使用Nuxt和Vuetify,不确定这是否有帮助!
v-slot
属性的简写形式。 - Edric