Skip to main content

Rich text

Setting type rich_text dùng để xuất ra trường văn bản nhiều dòng với các tùy chọn định dạng cơ bản sau:

  • Heading
  • Bold
  • Italic
  • Underline
  • Link
  • Paragraph
  • Unordered list
  • Color
  • Background color

Ngoài các thuộc tính Standard attributes của cài đặt đầu vào, cài đặt loại phạm vi còn có các thuộc tính sau:

AttributeDescriptiontypeDefaultRequire
toolbarItemsĐơn vị tínhToolbarItemspxno

Setting

  {
id: 'rich_text',
type: 'rich_text',
label: 'Rich text',
default: "<p>This is editable <strong>rich</strong> text, much better than a <code>textarea</code>!</p><p>Since it&#39;s rich text, you can do things like turn a selection of text <strong>bold</strong>, or add a semantically rendered block quote in the middle of the page, like this:</p>A wise quote.<p>Try it out for yourself!</p>",
},

Giao diện

alt

Data

Khi truy cập giá trị của rich_text , dữ liệu được trả về dưới dạng :

{settings.rich_text}

Output

 <p>This is editable <strong>rich</strong> text, much better than a <code>textarea</code>!</p><p>Since it's rich text, you can do things like turn a selection of text <strong>bold</strong>, or add a semantically rendered block quote in the middle of the page, like this:</p>A wise quote.<p>Try it out for yourself!</p>
```