# v-text

## Vue text 출력

`v-text` 키워드를 사용하여 태그 내부 텍스트(textContent)를 설정할 수 있다. 단, 기존에 작성된 내용은 사라지므로 사용 시 주의해야 한다.

```html
<태그 v-text="데이터"></태그>
```

### 사용 예제

```markup
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome to Vue JS 3</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="message">
        <div v-text="message"></div>
    </div>

    <script src="https://unpkg.com/vue@next"></script>
    <script>
        const app = Vue.createApp({
            data(){
                return {
                    message : "<h1>Hello VueJS!</h1>"
                };
            }
        });
        app.mount("#app");
    </script>
</body>
</html>
```

{% embed url="<https://codepen.io/hiphop5782/pen/wvPrqXv>" %}

`v-text`로 설정할 경우 데이터를 텍스트로 인식하여 태그 등이 효과를 발휘할 수 없다. 템플릿 출력과의 차이점은 다음 문서를 확인한다.

{% embed url="<https://docs.sysout.co.kr/web/develop-page/js/vuejs/single-vue3/vue-instance/template#v-html-vs-v-text>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sysout.co.kr/web/develop-page/js/vuejs/cdn-vue3/vue-directive/v-text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
