I would like my hideMe()
function to be called during the mounted
lifecycle hook in my Vuejs code. Currently it is not, and I don't understand why.
My code is below:
export default {
data() {
return {
show: "initial"
}
},
methods: {
hideMe() {
if(this.$vuetify.breakpoint.name == 'xs') {
console.log("When is this rendered? " + this.$vuetify.breakpoint.name == 'xs');
this.show = "none";
}
}
},
mounted() {
this.hideme();
console.log("This is a breakpoint name " + this.$vuetify.breakpoint.name);
console.log(this.show);
},
computed: {
imageHeight () {
switch (this.$vuetify.breakpoint.name) {
case 'xs': return '450px';
case 'sm': return '500px';
case 'md': return '500px';
case 'lg': return '540px';
case 'xl': return '540px';
}
}
}
};