vue在页面加载时触发的函数


//页面加载时触发的函数

methods: {
    getEmp: function() {
        // console.log(this.joke);
        var that = this;
        axios.post("http://localhost:8080/allEmp"
        ).then(function(response) {
            console.log(response.data);
            that.emps = response.data;
            // console.log(that.emps);
        }, function(err) {
            console.log(err);
        })
    },
},
mounted:function(){
    this.getEmp();
}