0

I have several local data variables named icon1Loading, icon2Loading, etc. How can I call variables dynamically to change their value?

data(){
  return {
    icon1Loading: false,
    icon2Loading: false
  }
}

changeLoadingState(iconNumber){
  this.icon${iconNumber}Loading = true
}
jj008
  • 1,033
  • 3
  • 23
  • 48

0 Answers0