export default {
name: 'HelloWorld',
props: {
msg: String
},
mounted() {
var vm = this;
vm.loaddata();
},
methods: {
async loaddata() {
var vm = this;
await vm.dowork();
console.log("C");
},
async dowork() {
var vm = this;
console.log("A");
await new Promise((resolve, reject) => {
vm.sayhello();//要执行的其它操作
resolve();
});
console.log("B");
},
sayhello() {
console.log("Say Hello.");
}
}
}