我需要在syncfusion的GridComponent中的每个单元格上方添加一些额外的信息(包含在数据源中)作为工具提示。
到目前为止我有
this
-虽然这似乎是为Vue 2设计的。。。
<ejs-tooltip ref="tooltip" target=".e-rowcell" :beforeRender="beforeRender">
<ejs-grid ref="grid" :dataSource="data" height="315px">
<e-columns>
<e-column field="OrderID" headerText="Order ID" textAlign="Right" width="90"></e-column>
<e-column field="CustomerID" headerText="Customer ID" width="120"></e-column>
<e-column field="Freight" headerText="Freight" textAlign="Right" format="C2" width="90"></e-column>
<e-column field="ShipName" headerText="Ship Name" width="120"></e-column>
</e-columns>
</ejs-grid>
</ejs-tooltip>
然后是beforeRender方法:
beforeRender: function (args) {
if (args.target.closest("td")) {
this.$refs.tooltip.content = args.target.innerText;
}
}
这不起作用($refs是vue 2的东西,对吗?)。。。
因此,如果我将vue3引用添加到工具提示中:
const tooltip = ref<TooltipComponent>(null);
我不能做那个工具提示。价值内容或工具提示。内容-它告诉我内容不存在。。。
我试着让:content属性指向一个方法,但这也不起作用。
我怀疑在vue 3中有更好的方法来做到这一点。。。