<div id="app">
<h1 v-html="url"></h1>
</div>
Vue2
const app = new Vue({
el: '#app',
data() {
return {
url: '<a href="http://www.baidu.com">百度</a>',
}
},
})
Vue3
const App = {
data() {
return {
url: '<a href="http://www.baidu.com">百度</a>',
}
},
}
Vue.createApp(App).mount('#app')