Iconfont cannot be displayed in mpvue

1.v-for loop different icons;
clipboard.png

2.
clipboard.png

3.

clipboard.png

4.v-for:

clipboard.png

clipboard.png

5. How can I make the icons looped out by v-for display normally?

May.22,2021

1. {{}} output elements as plain text
2.v-text outputs elements as plain text
3.v-html parses elements as HTML tags and outputs

you need to output item.icon as a html tag so that iconfont can render correctly.
the solution is as follows:
< li vmurfort = "(item, index)" in iconList ">

<i class="iconfont" v-html="item.icon"></i>


should be a loop when icon is treated as a string, and you can see if you can add double skimming: {{`item.icon`}}

Menu