v-text和v-html用法
作者:互联网
<!DOCTYPE html>
<html>
<style>
a {
margin: 40px;
}
</style>
<body>
<div id="app">
<p v-text="message"> {{ message }}</p>
<p v-text="message"> abc {{ message }}, def</p>
<p v-text="abc" v-text="message" v-text=", def"> {{ message }}</p>
<h1>{{ message1 }}</h1>
<p v-html="<h1>{{ message1 }}</h1>"></p>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
const vm = Vue.createApp({
data() {
return {
message: 'Hello Vue.js',
message1: 'Java无难事'
}
}
}).mount('#app')
</script>
</body>
</html>
标签:40px,Vue,const,abc,text,message1,用法,html,message 来源: https://blog.csdn.net/weixin_40945354/article/details/120132587