This article mainly introduces how Vue converts the string with html field passed from the background into HTML. Friends who need it can refer to
A string with label passed from the background can be directly converted by the front end. In html format, but what to do in vue
In this DEMO, the string contained in item.content will be converted into HTML code.
Note: The content in the tag using v-html will be replaced by item.content:
<p class="item" v-for="item in socialArray"> <dl v-html="item.content"> {{item.content}} </dl> </p>
The above is what I compiled for everyone Yes, I hope it will be helpful to everyone in the future.
Related articles:
webpack vue project development environment LAN access method
Configuration method for using sass in vue project
How to use the react-native package plug-in swiper
The above is the detailed content of Vue converts the string with html field passed from the background into HTML. For more information, please follow other related articles on the PHP Chinese website!