Office UI Fabric React: раскрывающийся компонент - PullRequest
0 голосов
/ 15 октября 2018

Как изменить CSS метки для Dropdown?Разметка указана ниже:

<Dropdown
      placeHolder="Select Department"
      label="Department:"
      id="Basicdrop1"
      ariaLabel="Department"
      options={[

        { key: 'A', text: 'Option a' },
        { key: 'B', text: 'Option b' },
        { key: 'C', text: 'Option c'},
        { key: 'D', text: 'Option d' },
        { key: 'E', text: 'Option e' },
      ]}
      onFocus={() =>console.log('onFocus called')}
      onBlur={() =>console.log('onBlur called')}
      componentRef={this._basicDropdown}
    />

Я хочу сделать ярлык «Отдел» жирным.

1 Ответ

0 голосов
/ 15 октября 2018

Вы можете оформить этикетку с помощью styles prop на <Dropdown/>.Вот пример кода, который отображает метку как полужирный:

<Fabric.Dropdown
  placeHolder="Select Department"
  label="Department:"
  id="Basicdrop1"
  ariaLabel="Department"
  options={[

    { key: 'A', text: 'Option a' },
    { key: 'B', text: 'Option b' },
    { key: 'C', text: 'Option c'},
    { key: 'D', text: 'Option d' },
    { key: 'E', text: 'Option e' },
  ]}
  onFocus={() =>console.log('onFocus called')}
  onBlur={() =>console.log('onBlur called')}
  componentRef={this._basicDropdown}
  styles={{ label: { fontWeight: 'bold' }}}
/>

Ссылки

...