const cfMx = ref; const index = propsrowid;如何判断cfMx里的数据的id是否与index相等并删除对应的数据
你可以使用Array.prototype.filter()方法来过滤cfMx数组中的数据,将不满足条件的数据过滤掉。如下所示:
cfMx.value = cfMx.value.filter(item => item.id !== index);
这将删除cfMx数组中id与index相等的数据。
原文地址: https://www.cveoy.top/t/topic/iT1Y 著作权归作者所有。请勿转载和采集!