在你的代码中,你使用了@click来绑定点击事件,但是你没有在方法名后面加上括号来传递参数。你需要修改你的代码,将@click绑定的方法改为以下形式:

@click="getDialogData(product.name)"

这样,当你点击td时,它将调用getDialogData方法,并将product.name作为参数传递给它。

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

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

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