【发布时间】:2019-07-05 04:44:38
【问题描述】:
我创建了级联下拉菜单。我需要根据父下拉选择加载下拉列表。我正在尝试使用 onpropertychange 事件。但我在 super.onpropertychange 上遇到错误,说 {Property 'onPropertyChange' 在类型 'BaseClientSideWebPart' 上不存在。}
请告诉我们我错过了什么。
protected onPropertyChange(propertyPath: string, newValue: any):void{
if(propertyPath === "listDropDown"){
// Change only when drop down changes
super.onPropertyChange(propertyPath,newValue);
// Clears the existing data
this.properties.ItemsDropDown = undefined;
this.onPropertyChange('ItemsDropDown', this.properties.ItemsDropDown);
// Get/Load new items data
this.GetItems();
}
else {
// Render the property field
super.onPropertyChange(propertyPath, newValue);
}
}
【问题讨论】:
标签: spfx