From 2f9ba45521bb5efaae45d1354c1c1114c67db270 Mon Sep 17 00:00:00 2001 From: mostafa Date: Fri, 9 Feb 2024 19:36:30 +0330 Subject: [PATCH] feat: translate built-in-directives --- .vscode/settings.json | 4 +- src/api/built-in-directives.md | 388 +++++++++++++++------------------ 2 files changed, 177 insertions(+), 215 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 088fd1c2..d46ef8d4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -26,6 +26,7 @@ "پلاتینیومی", "تایپ", "ترنزیشن‌", + "ترنزیشن", "تلپورت", "تمپلیت", "جاوااسکریپت", @@ -51,6 +52,7 @@ "کدنویسی", "کیلوبایتی", "گیت‌هاب", - "ماژولار" + "ماژولار", + "وبسایت" ] } \ No newline at end of file diff --git a/src/api/built-in-directives.md b/src/api/built-in-directives.md index f7ad1443..635e2420 100644 --- a/src/api/built-in-directives.md +++ b/src/api/built-in-directives.md @@ -1,92 +1,92 @@ -# Built-in Directives {#built-in-directives} +# دایرکتیو‌های داخلی {#built-in-directives} ## v-text {#v-text} -Update the element's text content. +محتوای متنی عنصر را به‌روزرسانی کند. -- **Expects:** `string` +- **انتظار دریافت ورودی با تایپ `string` دارد.** -- **Details** +- **جزئیات** - `v-text` works by setting the element's [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) property, so it will overwrite any existing content inside the element. If you need to update the part of `textContent`, you should use [mustache interpolations](/guide/essentials/template-syntax#text-interpolation) instead. + `v-text` با تنظیم پراپرتی [textContent](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) عنصر کار می‌کند، بنابراین محتوای موجود درون عنصر را جایگزین خواهد کرد. اگر نیاز به به‌روزرسانی بخشی از `textContent` دارید، باید به جای آن از [قابلیت درج متن](/guide/essentials/template-syntax#text-interpolation) استفاده کنید. -- **Example** +- **مثال** ```vue-html - + {{msg}} ``` -- **See also** [Template Syntax - Text Interpolation](/guide/essentials/template-syntax#text-interpolation) +- **همچنین ببینید** [Template Syntax - درج متن](/guide/essentials/template-syntax#text-interpolation) ## v-html {#v-html} -Update the element's [innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML). +[innerHTML](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) عنصر را به‌روزرسانی می‌کند. -- **Expects:** `string` +- **انتظار دریافت ورودی با تایپ `string` دارد.** -- **Details** +- **جزئیات** - Contents of `v-html` are inserted as plain HTML - Vue template syntax will not be processed. If you find yourself trying to compose templates using `v-html`, try to rethink the solution by using components instead. + محتویات `v-html` به عنوان HTML خام درج می‌شوند - کدهایی که سینتکس تمپلیت Vue را دارند، پردازش نخواهد شد. اگر در حال تلاش برای ترکیب تمپلیت‌ها با استفاده از `v-html` هستید، سعی کنید مجدداً راه حل را با استفاده از کامپوننت‌ها بیاندیشید. - ::: warning Security Note - 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. + ::: warning نکته امنیتی + رندر کردن HTML دلخواه در وبسایت شما می‌تواند بسیار خطرناک باشد زیرا به راحتی می‌تواند منجر به [حملات XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) شود. تنها از `v-html` روی محتوای قابل اعتماد استفاده کنید و **هرگز** روی محتوای تأمین شده توسط کاربر از آن استفاده نکنید. ::: - In [Single-File Components](/guide/scaling-up/sfc), `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](./sfc-css-features#css-modules) or an additional, global `