Entering a number increases the number of rows. The index is displayed, but the data is not displayed. How should I display it?
list year, list month has a picklist of years and months
Ultimately, when selectyear: 2022 / selectmonth: 11 / num: 3 I want it to show as 2022.11 , 2022.12 , 2023.1 .
cmp
<lightning:combobox
class="slds-size_1-of-2"
placeholder="select year!"
options="{!v.listYear}" value="{!v.selectYear}"
name="year" label="year"
required="true"
/>
<lightning:combobox
class="slds-size_1-of-2"
placeholder="select month!"
options="{!v.listMonth}" value="{!v.selectMonth}"
Name="month" label ="month"
required="true"
/>
<lightning:input
class="slds-size_1-of-2"
type="number" name="number" label="number"
placeholder="write the number"
required="true"
onchange="{!c.fnOnChange}"
value="{!v.splitNum}"
/>
...
<tbody>
<aura:iteration items="{!v.records}" var="rec" indexVar="index">
<tr>
<lightning:layout>
<lightning:layoutItem size="2">
<td>
{!index+1}
</td>
</lightning:layoutItem>
<lightning:layoutItem size="2">
<td>
(((( 2 combobox data ex)year.month ))))
</td>
</lightning:layoutItem>
</lightning:layout>
</tr>
</aura:iteration>
</tbody>
controller.js
fnOnChange : function(component, event, helper){
// var year = component.get("v.selectYear");
// var month = component.get("v.selectMonth");
var listRecords = [];
var lineCount = component.get("v.splitNum");
var objTemp = {};
for(var i=0; i<parseInt(lineCount); i++){
objTemp={};
objTemp["var1"] = '';
objTemp["var2"] = '';
objTemp["var3"] = '';
objTemp["var4"] = '';
listRecords.push(objTemp);
}
component.set("v.records", listRecords);
}