how to run method in method vue js on load

JavaScript
 ....
 methods:{
     getUnits: function() {...}
 },
 beforeMount(){
    this.getUnits()
 },
 ......

Source

Also in JavaScript: