The data returned by Mini Program through Filter is tagged with text and rendered on the page without parsing.

res.data.content.filter((value) => {
                value.createAt = util.formatTimeDistance(new Date(value.createAt));
                let keyword = that.data.params;
                let re = new RegExp(keyword, "g");
                value.title = value.title.replace(re, `<text class="keyword">${keyword}</text>`);
                return value
              })

as above, I added Filter and added a text tag to the title that contains keyword, but what if the page doesn"t render?

clipboard.png

Apr.07,2021

if you want to change the style, use rich-text as a rich text to render

Menu