tunafish24 Asked: 2023-09-11 22:08:47 +0800 CST2023-09-11 22:08:47 +0800 CST 2023-09-11 22:08:47 +0800 CST 如何在 vuetify 3 中向数据表标题添加工具提示? 772 如何将工具提示添加到 Vuetify 3 数据表标题而无需重新实现排序功能? 几年前有一个类似问题的答案,但它是针对 Vuetify 2 的:https ://stackoverflow.com/a/58718975/934257 vuetify.js 1 个回答 Voted Best Answer Moritz Ringler 2023-09-12T05:42:53+08:002023-09-12T05:42:53+08:00 与链接的答案中的工作方式相同,只是现在header.${string}调用插槽column.${string},并且工具提示的activator插槽现在获取一个props值而不是on: <v-data-table :headers="headers" :items="items" > <template v-for="h in headers" v-slot:[`column.${h.key}`]="{ column }" > <v-tooltip> <template v-slot:activator="{ props }"> <span v-bind="props">{{ h.title }}</span> </template> <span>{{ h.title }}</span> </v-tooltip> </template> </v-data-table> 这是在游乐场
与链接的答案中的工作方式相同,只是现在
header.${string}
调用插槽column.${string}
,并且工具提示的activator
插槽现在获取一个props
值而不是on
:这是在游乐场