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
  • 913
  • 2
  • 18
  • 39

0 Answers0