Skip to content

Commit 685078e

Browse files
committed
Started translation of components-props.md
1 parent f1fcbfe commit 685078e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/v2/guide/components-props.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -87,62 +87,62 @@ props: {
8787
### Передача булевого значення
8888

8989
```html
90-
<!-- Including the prop with no value will imply `true`. -->
90+
<!-- Додавання булевого вхідного параметру без значення означатиме булеве значення `true`. -->
9191
<blog-post is-published></blog-post>
9292

93-
<!-- Even though `false` is static, we need v-bind to tell Vue that -->
94-
<!-- this is a JavaScript expression rather than a string. -->
93+
<!-- Хоча `false` і статичне, ми повинні використовувати v-bind, щоб вказати Vue, що -->
94+
<!-- це є виразом JavaScript, а не рядкове значення. -->
9595
<blog-post v-bind:is-published="false"></blog-post>
9696

97-
<!-- Dynamically assign to the value of a variable. -->
97+
<!-- Динамічна передача значення через змінну. -->
9898
<blog-post v-bind:is-published="post.isPublished"></blog-post>
9999
```
100100

101-
### Passing an Array
101+
### Передача масиву
102102

103103
```html
104-
<!-- Even though the array is static, we need v-bind to tell Vue that -->
105-
<!-- this is a JavaScript expression rather than a string. -->
104+
<!-- Хоча масив і статичний, ми повинні використовувати v-bind, щоб вказати Vue, що -->
105+
<!-- це є виразом JavaScript, а не рядкове значення. -->
106106
<blog-post v-bind:comment-ids="[234, 266, 273]"></blog-post>
107107

108-
<!-- Dynamically assign to the value of a variable. -->
108+
<!-- Динамічна передача значення через змінну. -->
109109
<blog-post v-bind:comment-ids="post.commentIds"></blog-post>
110110
```
111111

112-
### Passing an Object
112+
### Передача об'єкту
113113

114114
```html
115-
<!-- Even though the object is static, we need v-bind to tell Vue that -->
116-
<!-- this is a JavaScript expression rather than a string. -->
115+
<!-- Хоча об'єкт і статичний, ми повинні використовувати v-bind, щоб вказати Vue, що -->
116+
<!-- це є виразом JavaScript, а не рядкове значення. -->
117117
<blog-post
118118
v-bind:author="{
119119
name: 'Veronica',
120120
company: 'Veridian Dynamics'
121121
}"
122122
></blog-post>
123123

124-
<!-- Dynamically assign to the value of a variable. -->
124+
<!-- Динамічна передача значення через змінну. -->
125125
<blog-post v-bind:author="post.author"></blog-post>
126126
```
127127

128-
### Passing the Properties of an Object
128+
### Передача властивостей об'єкту
129129

130-
If you want to pass all the properties of an object as props, you can use `v-bind` without an argument (`v-bind` instead of `v-bind:prop-name`). For example, given a `post` object:
130+
Якщо ви хотіли б передати всі властивості об'єкту, як вхідні параметри, ви можете скористатися `v-bind` без аргументу (`v-bind` замість `v-bind:prop-name`). Для прикладу, в нас є об'єкт `post`:
131131

132132
``` js
133133
post: {
134134
id: 1,
135-
title: 'My Journey with Vue'
135+
title: 'Мій шлях з Vue'
136136
}
137137
```
138138

139-
The following template:
139+
Наступний шаблон:
140140

141141
``` html
142142
<blog-post v-bind="post"></blog-post>
143143
```
144144

145-
Will be equivalent to:
145+
Еквівалентний наступному:
146146

147147
``` html
148148
<blog-post
@@ -151,13 +151,13 @@ Will be equivalent to:
151151
></blog-post>
152152
```
153153

154-
## One-Way Data Flow
154+
## Односторонній перебіг даних
155155

156-
All props form a **one-way-down binding** between the child property and the parent one: when the parent property updates, it will flow down to the child, but not the other way around. This prevents child components from accidentally mutating the parent's state, which can make your app's data flow harder to understand.
156+
Всі вхідні параметри формують **односторонній зв'язок** між дочірніми властивостями та батьківським: коли батьківська властивість змінюється, це перейде вниз аж до дочірніх, але не навпаки. Це запобігає дочірні компоненти випадково мутувати стан батьківських, щоб могло б зробити перебіг даних вашого застосунку складнішим для розуміння.
157157

158-
In addition, every time the parent component is updated, all props in the child component will be refreshed with the latest value. This means you should **not** attempt to mutate a prop inside a child component. If you do, Vue will warn you in the console.
158+
Крім того, щоразу, коли батьківський компонент оновлено, всі вхідні параметри дочірнього компоненту будуть оновлені автоматично новими значеннями. Це означає, що ви **не** повинні намагатися мутувати вхідний параметр усередині дочірньої компоненти. Якщо ж ви спробуєте це зробити, Vue попередить вас в консолі розробника.
159159

160-
There are usually two cases where it's tempting to mutate a prop:
160+
Як правило, існує два випадки, де хочеться змінити вхідний параметр:
161161

162162
1. **The prop is used to pass in an initial value; the child component wants to use it as a local data property afterwards.** In this case, it's best to define a local data property that uses the prop as its initial value:
163163

0 commit comments

Comments
 (0)