是否可以像同步一样执行并在调用方法本身中获取结果。所以,我想在 $emit 完成后执行下一条语句。其如下:
Parent component has method,
doCustomValidation();
child component is as follow:
methods:
{
Save: function(){
// Can I get the response here from parent component and then, execute
doGenericValidation ?
var errorFields = this.$emit('custom-validation');
doGenericValidation(errorFields); //this is generic validations
}
Run Code Online (Sandbox Code Playgroud)