我正在使用MDC,并且有一个与MDCTextField有关的问题。我有一个输入元素,其中不断显示辅助文字:
<div class="mdc-text-field">
<input type="text" id="username" class="mdc-text-field__input"
aria-controls="username-helper-text"
aria-describedby="username-helper-text">
<label for="username" class="mdc-floating-label">Username</label>
<div class="mdc-line-ripple"></div>
</div>
<div class="mdc-text-field-helper-line">
<div id="username-helper-text" class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent" aria-hidden="true">
This will be displayed on your public profile
</div>
</div>
类似于此处显示的内容:https://material.io/develop/web/components/input-controls/text-field/helper-text/
我需要在帮助器文本中添加一个自定义CSS类。文档说我可以使用MDCTextFieldHelperTextAdapter和addClass方法。这正是我迷路的地方。请提供一个示例,说明如何完成该操作。
谢谢。