diff --git a/src/api/directives.md b/src/api/directives.md index 8116c019..e6bbeb29 100644 --- a/src/api/directives.md +++ b/src/api/directives.md @@ -2,79 +2,79 @@ ## v-text -- **Expects:** `string` +- **受け入れ型:** `string` -- **Details:** +- **詳細:** - Updates the element's [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent). If you need to update the part of `textContent`, you should use [mustache interpolations](/guide/template-syntax.html#text) instead + 要素の [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) を更新します。`textContent` の一部を更新する必要がある場合、代わりに [Mustache 展開](/guide/template-syntax.html#text) を使う必要があります。 -- **Example:** +- **例:** ```html - + {{msg}} ``` -- **See also:** [Data Binding Syntax - Interpolations](../guide/template-syntax.html#text) +- **参照:** [データバインディング構文 - 展開](../guide/template-syntax.html#テキスト) ## v-html -- **Expects:** `string` +- **受け入れ型:** `string` -- **Details:** +- **詳細:** - Updates the element's [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML). **Note that the contents are inserted as plain HTML - they will not be compiled as Vue templates**. If you find yourself trying to compose templates using `v-html`, try to rethink the solution by using components instead. + 要素の [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) を更新します。**この内容はふつうの HTML として挿入され、Vue テンプレートとしてコンパイルされないことに注意してください**。もし `v-html` を使ってテンプレートを構成しようとしている場合、代わりにコンポーネントを使って解決できないか考え直してみてください。 ::: warning - Dynamically rendering arbitrary HTML on your website can be very dangerous because it can easily lead to [XSS attacks](https://en.wikipedia.org/wiki/Cross-site_scripting). Only use `v-html` on trusted content and **never** on user-provided content. + あなたのウェブサイトで任意の HTML を動的にレンダリングすることは、[XSS 攻撃](https://en.wikipedia.org/wiki/Cross-site_scripting) に簡単につながるため、非常に危険です。`v-html` は信用できるコンテンツのみに使い、ユーザが提供するコンテンツには **決して** 使わないでください。 ::: - In [single-file components](../guide/single-file-component.html), `scoped` styles will not apply to content inside `v-html`, because that HTML is not processed by Vue's template compiler. If you want to target `v-html` content with scoped CSS, you can instead use [CSS modules](https://vue-loader.vuejs.org/en/features/css-modules.html) or an additional, global `