<template>
<div v-html="htmlMsg"></div>
</template>
<script>
export default {
data(){
return {
htmlMsg : '<h3 style="color : orange;">Hello h3</h3>'
}
},
}
</script>
저렇게 태그에 v-html="태그및데이터"
저렇게 안하면 그냥 그대로 읽혀짐. 이스케이프를 안시켜준다.
'Vue.js' 카테고리의 다른 글
computed 템플릿 내에서 간단한 연산 (0) | 2023.09.27 |
---|---|
data(), v-bind (0) | 2023.09.27 |
v-once 한번만 랜더링 (0) | 2023.09.27 |
Vue 라이프 사이클 (0) | 2023.09.25 |
반복문, 조건문 (0) | 2023.09.21 |