跳转到正文

组件

文本域

会随行数增长的多行文本字段。

用法

基础

HTML
<bs:bsui-textarea rows="4" placeholder="Release notes" />

带标签

标签在上,帮助文本在下,结构与其他字段相同。

Markdown is supported.
HTML
<bs:bsui-field>
  <bs:bsui-field-label text="Release notes" />
  <bs:bsui-textarea name="notes" rows="5" placeholder="What changed in this release?" />
  <bs:bsui-field-description text="Markdown is supported." />
</bs:bsui-field>

无效状态

错误颜色会像应用于输入框一样,延伸到文本区域边框。

Let us know before you cancel.
HTML
<bs:bsui-field invalid="true">
  <bs:bsui-field-label text="Why are you leaving?" />
  <bs:bsui-textarea rows="4" placeholder="Tell us what went wrong." />
  <bs:bsui-field-error text="Let us know before you cancel." />
</bs:bsui-field>

已禁用

控件保留占位符,但无法获得焦点或接受编辑。

HTML
<bs:bsui-textarea rows="3" disabled="true" placeholder="Notes are locked while the release is publishing." />

属性

属性类型默认
placeholder text —
rows number 4
name text —
disabled toggle false
onChange text —
value text —