原因是lightning:dualListbox控件需要写全”label”, “sourceLabel”, “selectedLabel”, “options”属性。
参考官网写法:
<aura:component>
<aura:attribute name="listOptions" type="List" default="[]"/>
<aura:attribute name="defaultOptions" type="List" default="[]"/>
<aura:attribute name="requiredOptions" type="List" default="[]"/>
<aura:handler name="init" value="{! this }" action="{! c.initialize }"/>
<lightning:dualListbox aura:id="selectOptions" name="Select Options" label= "Select Options"
sourceLabel="Available Options"
selectedLabel="Selected Options"
options="{! v.listOptions }"
value="{! v.defaultOptions }"
requiredOptions="{! v.requiredOptions }"
onchange="{! c.handleChange }"/>
</aura:component>
本文介绍了解决Salesforce Lightning DualListbox组件在Spring '18版本中出现的错误方法。要避免此错误,必须完整填写所有必要属性,包括label, sourceLabel, selectedLabel及options。提供了正确的组件配置示例。
1448

被折叠的 条评论
为什么被折叠?



