action.set salesforce中的回调


getAllvehicleList : function(component, event, helper)
{
var action = component.get("c.retrieveVehicle");
action.setParams({'status':component.get("v.status")});
action.setCallback(this, fuction(data) {

enter code here
component.set('v.vehicleList',data.getRetrunValue())                       
});
$A.enqueueAction(action);
}

线路:5错误:分析错误:意外的令牌{

请解释此代码第4行出现的错误。

您的JavaScript关键字function拼写错误。

您还拼错了标准Aura方法名称getReturnValue()

犯这样的错误通常会导致编译器向您显示明显没有意义的错误,因为它们并不能反映您的意图,而是反映您实际写的内容。如果你掌握了校对自己代码的技能,你就能更快地取得进展。编辑器中的语法高亮显示和ESLint等工具也可以帮助发现这种类型的错误。

最新更新