From 7add2e70c24c6b690879b500106f8f5b885c8172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D8=AD=D9=85=D8=AF=20=D8=B4=D8=B1=D9=81=DB=8C?= <80104926+MMDShen@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:59:11 +0330 Subject: [PATCH 01/23] Update built-in-special-attributes.md to fa version --- src/api/built-in-special-attributes.md | 78 +++++++++++++------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/src/api/built-in-special-attributes.md b/src/api/built-in-special-attributes.md index 3dfb7523..a3afe85d 100644 --- a/src/api/built-in-special-attributes.md +++ b/src/api/built-in-special-attributes.md @@ -1,18 +1,18 @@ -# Built-in Special Attributes {#built-in-special-attributes} +# ویژگیهای خاص ساخته شده {#built-in-special-attributes} -## key {#key} +## کلید {#key} -The `key` special attribute is primarily used as a hint for Vue's virtual DOM algorithm to identify vnodes when diffing the new list of nodes against the old list. +ویژگی خاص `key` به عنوان یک راهنما برای الگوریتم DOM مجازی Vue استفاده میشود تا هنگام تفاوتیابی لیست جدید گرهها با لیست قدیمی، vnodes را شناسایی کند. -- **Expects:** `number | string | symbol` +- **انتظارات:** `number | string | symbol` -- **Details** +- **جزئیات** - Without keys, Vue uses an algorithm that minimizes element movement and tries to patch/reuse elements of the same type in-place as much as possible. With keys, it will reorder elements based on the order change of keys, and elements with keys that are no longer present will always be removed / destroyed. +بدون Vue ، Key از یک الگوریتم استفاده میکند که حرکت عناصر را به حداقل میرساند و سعی میکند عناصر هم نوع را در جای خود ترمیم/باز استفاده کند تا حد امکان. با key، این عناصر را بر اساس تغییر ترتیب keyها مرتب میکند و عناصری که دارای `key`هایی هستند که دیگر وجود ندارند، همیشه حذف / نابود میشوند. - Children of the same common parent must have **unique keys**. Duplicate keys will cause render errors. +فرزندان یک والد مشترک باید دارای key های منحصر به فرد باشند. key های تکراری باعث خطاهای رندر میشوند. - The most common use case is combined with `v-for`: +مورد استفاده رایجترین این ویژگی، همراه با `v-for` است: ```vue-html ``` - It can also be used to force replacement of an element/component instead of reusing it. This can be useful when you want to: - - Properly trigger lifecycle hooks of a component - - Trigger transitions +این ویژگی را میتوان برای اجبار جایگزینی یک عنصر/کامپوننت به جای باز استفاده از آن نیز استفاده کرد. این میتواند زمانی مفید باشد که شما بخواهید: - For example: +• به درستی هوک های چرخه حیات یک کامپوننت را فعال کنید + +• ترنزیشن را فعال کنید + +برای مثال: ```vue-html @@ -33,28 +35,28 @@ The `key` special attribute is primarily used as a hint for Vue's virtual DOM al ``` - When `text` changes, the `` will always be replaced instead of patched, so a transition will be triggered. + وقتی `text` تغییر کند، `` همیشه جایگزین شده به جای ترمیم شده، بنابراین یک ترنزیشین فعال میشود. -- **See also** [Guide - List Rendering - Maintaining State with `key`](/guide/essentials/list#maintaining-state-with-key) +- **همچنین ببینید** [راهنما - لیست رندرینگ - حفظ حالت با `key`](/guide/essentials/list#maintaining-state-with-key) -## ref {#ref} +## مرجع {#ref} -Denotes a [template ref](/guide/essentials/template-refs). +یک [تمپلیت مرجع](/guide/essentials/template-refs) را نشان میدهد. -- **Expects:** `string | Function` +- **انتظارات:** `string | Function` -- **Details** +- **جزپیات** - `ref` is used to register a reference to an element or a child component. + `ref` برای ثبت یک مرجع به یک عنصر یا یک کامپوننت فرزند استفاده میشود. - In Options API, the reference will be registered under the component's `this.$refs` object: +در API آپشن، مرجع زیر شیء `this.$refs` کامپوننت ثبت میشود: ```vue-html

hello

``` - In Composition API, the reference will be stored in a ref with matching name: + در Composition API, مرجع در یک مرجع با نام منطبق ذخیره می شود: ```vue