[Vuejs]-$t is undefined inside of component filter

0👍

Rearraing your code like this. it will work

   filters: {
formatStatus (value,self) {
  let status = {
    active: {
      text: self.$t('general.successful'),
      class: 'secondary--text'
    },
    processing: {
      text: self.$t('general.processing'),
      class: 'tertiary--text'
    },
    waiting: {
      text: self.$t('general.pending'),
      class: 'tertiary--text'
    }
  }
  return status[value]
}
}

call filter like :

{{yourvalue | formatStatus(this)}} 

Leave a comment