Vue Computed Component Not Firing

Viewed 23

I've been running the Vue extension for Chrome. As soon as I turned it off, none of my computed components work. All of my data comes from Django. One example:

import axios from 'axios'
    

export default { 
    name: 'Game',
    
    data() { 
        return { 
            game: {},
            newDate: ''
        }
    },

    computed: {
        dateNoTime() { 
                    this.newDate = this.game.date.substring(0, this.game.date.indexOf("T"));
        }

If I have the Vue extension loaded, using {{ newDate }} works just fine. Without it, however, nothing gets pulled. I've tried a method as well with no luck.

2 Answers

this one worked when I tested it

methods: {
  dateNoTime: function () { 
    this.newDate = this.game.date.toJSON().slice(0,10).replace(/-/g,'/');
  }
},
  mounted () {
  this.dateNoTime()
}
Related