你可以尝试通过在点击事件中使用v-bind绑定参数的方式来传递参数给getDialogData方法。具体代码如下:

<td @click="getDialogData(product.name)">
    <el-image class="ProductImage" th:src="${product.imgUrl}" :fit="cover"></el-image>
    <span class="ProductName" th:text="${product.name}">product-name</span>
</td>

在上述代码中,我将click事件绑定到getDialogData方法,并使用v-bindproduct.name作为参数传递给该方法。这样,当你点击td元素时,getDialogData方法将接收到正确的参数。

希望对你有帮助!

这是我的前端代码:div class=Products table tr theach=product productStat $indexProducts thif=$productStatindex 3 == 0 td el

原文地址: https://www.cveoy.top/t/topic/iUlD 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录