Я хочу переключить видимость элементов ввода в таблице (таблица Buefy). Это переключение должно быть сделано щелчком флажка.
Данные модели генерируются динамически после вызова API, а затем присваиваются значения (по умолчанию false).
Я также пытался использовать this.nextTick(()=>{}), но это не меняет его. Событие запускается, и console.log также дает значения динамически генерируемых моделей
export default {
name:'Dashboard',
data() {
return {
maxMatches :{
},
}
},
mounted(){
const ctx=this
this.apiService.getLiveMatches().then(function(response){
for (var i=0;i<response.length;i++){
ctx.data.push({'sr':i,'match_id':response[i]['match_id'],'match_title':response[i]['short_title'],'match_status':response[i]['status_note'],'start_date':response[i]['date_start'],'type':response[i]['domestic'],'priority':""})
// THis is where I am generating models dynamically
ctx.maxMatches[response[i]['match_id']] = false
}
ctx.matchData = response
})
this.apiService.getDomesticPriorities().then(function(response){
ctx.refreshDomesticUi(response)
})
this.apiService.getInternationalPriorities().then(function(response){
ctx.refreshInternationalUi(response)
})
},
}
// Template snippet goes here , this is a column of a table where the checkbox and input field resides
<b-table-column field="priority " label="Priority" >
<div class="selection">
<b-checkbox @change.native="checkboxChanged(props.row)" :id="props.row.match_id" :ref="props.row.type ==0 ? 'int'+props.row.sr+'-check-': 'dom'+props.row.sr+'-check' " ></b-checkbox>
<b-field
:id="props.row.match_id +'b-field'"
v-if="maxMatches[props.row.match_id]"
label="Quantity"
type="is-danger"
message="Quantity is invalid">
<b-numberinput :id="props.row.match_id" ></b-numberinput>
</b-field>
<p > is this visible ???</p>
<!-- <b-checkbox v-for="i in domChecks" :key="i" :ref="props.row.type ==0 ? 'int'+props.row.sr+'-check-'+i : 'dom'+props.row.sr+'-check'+i " @click.native="checkBoxClick(props.row.type,props.row.sr,i)"></b-checkbox> -->
</div>
</b-table-column>