【问题标题】:How do I change the placeholder text?如何更改占位符文本?
【发布时间】:2019-05-18 21:44:53
【问题描述】:

添加以下道具似乎不起作用

text={{placeholder: "选择产品"}}

<DropdownTreeSelect
      data={data}
      texts={{placeholder: 'Some other text'}}
      onChange={onChange}
      className="bootstrap-demo"
    />

占位符文本仍会显示默认的“选择...”

【问题讨论】:

    标签: react-dropdown-tree-select


    【解决方案1】:

    道具名称为placeholderTexttry:

    <DropdownTreeSelect
          data={data}
          placeholderText={'Some other text'}
          onChange={onChange}
          className="bootstrap-demo"
        />
    

    【讨论】:

    • 其他地方有其他文档吗? github上的文档没有这个。
    • 是的,这很奇怪。看起来NPM 上的文档有所不同。
    • 好像master分支和develop分支不一样。
    【解决方案2】:

    我尝试使用 texts={{ placeholder: "Search" }} 并且效果非常好!

    【讨论】:

      猜你喜欢
      • 2017-03-31
      • 1970-01-01
      • 2019-12-09
      • 2013-10-06
      • 1970-01-01
      • 2020-11-28
      • 2012-03-03
      • 2017-05-18
      • 2013-02-04
      相关资源
      最近更新 更多