Home > Article > Web Front-end > Text rendering with Vue.js
This time I will bring you Vue.js text rendering. What are the precautions for using Vue.js text rendering? Here is the actual combat Let’s take a look at the case.
<template> <div id="myapp"> <p v-text="hello"></p> <p v-html="hello"></p> <p>{{num+1}}</p> {{status ? 'success' : 'fail'}} </div></template><script> export default { data: function () { return { hello: '<span>你是猴子请来的逗比吗?</span>', num: 1, status: true } } }</script>
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
What are the precautions when using Vue.js
In-depth JavaScript movement of JS
In-depth advanced application of DOM in JavaScript
The above is the detailed content of Text rendering with Vue.js. For more information, please follow other related articles on the PHP Chinese website!