从PropertyPaneFields清除值

时间:2018-08-13 18:54:58

标签: typescript sharepoint

在玩我的PropertyPane Web部件时,我意识到输入的值永远不会被清除。窗格会记住我的输入,但是我无法删除这些输入。

  private _getCreateJobFields(): IPropertyPaneField<any>[] {
    /...
    myPropertyPaneTextField = PropertyPaneTextField('textFieldNameCompany', {
      label: 'Company',
      placeholder: 'Enter Company Name',
      value: 'Some Value'
    });

    fields.push(myPropertyPaneTextField);

    fields.push(PropertyPaneTextField('textFieldNameJob', {
       label: 'Job',
       placeholder: 'Enter Job Name',
       value: "test value"
    }));
    .../
  }

  protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
    return {
      pages: [
        {
          header: {
            description: strings.PropertyPaneDescription
          },
          groups: [
            {
              groupName: strings.BasicGroupName,
              groupFields: this._getCreateJobFields()
            }
          ]
        }
      ]
    };
  }

My Property Pane

我的PropertyPane没有反应,我知道onAfterPropertyPaneChangesAPplied()功能,但是我不确定如何从那里清除propertypanefield

0 个答案:

没有答案