[Vuejs]-Vue/Vuetify: why am I getting a ReferenceError: variable is not defined?

0👍

The variable needs to be declared beforehand (not in the same object):

export default {
  data() {
    const makEosComputer = 0
    const makEosUserTotal = 0
    const makArchComputer = 0
    const makArchUserTotal = 0
    const makDataComputer = 0
    const makDataUserTotal = 0

    return {
      makEosComputer,
      makEosUserTotal,
      makArchComputer,
      makArchUserTotal,
      makDataComputer,
      makDataUserTotal,
      cards: [
        {title: 'Eos Lab', comps: makEosComputer, users: makEosUserTotal},
        {title: 'Arch Lab', comps: makArchComputer, users: makArchUserTotal},
        {title: 'Data Comm Lab', comps: makDataComputer, users: makDataUserTotal}
      ],
    }
  }
}

Leave a comment