<template for:each={price.Rates} for:item="rate" for:index="rindex" >
<tr key={rate.Price_Authority__c} >
<td>
<lightning-input type="checkbox" value={rate.Comment} data-item={rate} onclick={handleChildClick}></lightning-input>
</td>
<td>
<div class="slds-truncate slds-cell-wrap">{rate.Price_Authority__c}</div>
</td>
</tr>
</template>
handleChildClick(event){
alert(typeof event.target.getAttribute('data-item')); --> string
alert(event.target.getAttribute('data-item')); ----------> '[object Object]'
}
在输入框上单击/更改事件...我无法在event.target.getAttribute('data-item')中获取迭代项对象。我正在获取字符串而不是对象