Home > Web Front-end > JS Tutorial > Vue converts the string with html field passed from the background into HTML

Vue converts the string with html field passed from the background into HTML

亚连
Release: 2018-05-28 14:34:38
Original
2384 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template