Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slots #57

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/tutorial/src/step-14/description.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Slots {#slots}

In addition to passing data via props, the parent component can also pass down template fragments to the child via **slots**:
علاوه بر اینکه می‌توان داده‌ها را از طریق props به فرزند ارسال کرد، کامپوننت والد همچنین می‌تواند بخشی از تمپلیت را به فرزند از طریق **slots (اسلات‌ها)** ارسال کند:

<div class="sfc">

Expand All @@ -21,7 +21,7 @@ In addition to passing data via props, the parent component can also pass down t

</div>

In the child component, it can render the slot content from the parent using the `<slot>` element as outlet:
کامپوننت فرزند می‌تواند محتوای slot آمده از والد را با استفاده از عنصر `<slot>` به عنوان نقطه‌خروج (outlet) نمایش دهد:

<div class="sfc">

Expand All @@ -40,10 +40,10 @@ In the child component, it can render the slot content from the parent using the

</div>

Content inside the `<slot>` outlet will be treated as "fallback" content: it will be displayed if the parent did not pass down any slot content:
محتوای داخل `<slot>` به عنوان محتوای "جایگزین" (fallback) تلقی می‌شود: اگر والد محتوای اسلاتی ارسال نکرده باشد، این محتوا نمایش داده خواهد شد.

```vue-html
<slot>Fallback content</slot>
```

Currently we are not passing any slot content to `<ChildComp>`, so you should see the fallback content. Let's provide some slot content to the child while making use of the parent's `msg` state.
در حال حاضر ما هیچ محتوایی تحت اسلات به `<ChildComp>` ارسال نمی‌کنیم، بنابراین شما باید محتوای جایگزین را ببینید. بیایید محتوای از جنس slot را به فرزند ارائه دهیم و در عین حال از state تعریف شده `msg` والد استفاده کنیم.