Display issues of uniapp rich text and mobile rich text

There are several ways to display rich text:

1.<view  v-html="content"></view>

2. uniapp comes with the component rich-text

rich-text | uni-app official website

<rich-text :nodes="content"></rich-text>

3.uView component u-parse

Parse rich text parser | uView 2.0 - uni-app ecological framework fully compatible with nvue - uni-app UI framework

<u-parse :content="content" :tagStyle="style"></u-parse>


Format:

        If you have higher requirements for the format, such as individually modifying the style of a rich text label, adapting images, uniformly setting font colors, etc., it is recommended to use the third display method (u-parse)

  • U-parse internally sets adaptive styles for tags such as pictures and videos, so there is no need to format them yourself.
  • The tagStyle parameter of the u-parse component can finely set styles for individual tags.
  • Through the parent element tag, uniformly set the color, line height, font size, etc. of the full text

Detailed setting method: refer toofficial website documentation

Guess you like

Origin blog.csdn.net/weixin_44805839/article/details/134551621