You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/guide/reactivity.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,20 @@
2
2
3
3
Agora é o momento de mergulhar fundo! Uma das características mais distintas do Vue é o seu discreto sistema de reatividade. Models são _proxies_ de objetos JavaScript. Quando você os modifica, a _view_ é atualizada. Isso faz com que a administração de estado seja simples e intuitiva, porém é importante entender como isso funciona para evitar algumas pegadinhas. Nesta seção, vamos nos aprofundar em alguns dos detalhes de baixo nível do sistema de reatividade do Vue.
4
4
5
-
<VideoLessonhref="https://www.vuemastery.com/courses/vue-3-reactivity/vue3-reactivity"title="Learn how how reactivity works in depth with Vue Mastery">Assista um vídeo gratuito sobre Aprofundando-se na Reatividade no Vue Mastery</VideoLesson>
5
+
<VideoLessonhref="https://www.vuemastery.com/courses/vue-3-reactivity/vue3-reactivity"title="Aprenda a fundo como a reatividade funciona com o Vue Mastery">Assista um vídeo gratuito sobre Aprofundando-se na Reatividade no Vue Mastery</VideoLesson>
6
6
7
-
## What is Reactivity?
7
+
## O que é Reatividade?
8
8
9
-
This term comes up in programming quite a bit these days, but what do people mean when they say it? Reactivity is a programming paradigm that allows us to adjust to changes in a declarative manner. The canonical example that people usually show, because it’s a great one, is an excel spreadsheet.
9
+
Esse termo aparece na programação com uma certa frequência atualmente, mas o que as pessoas entendem por isso? Reatividade é um paradigma de programação que nos permite nos ajustar a mudanças de uma maneira declarativa. O exemplo canônico que as pessoas geralmente mostram, por ser um ótimo exemplo, é uma planilha do excel.
Seu navegador não possui suporte para a tag video.
14
14
</video>
15
15
16
-
If you put the number two in the first cell, and the number 3 in the second and asked for the SUM, the spreadsheet would give it to you. No surprises there. But if you update that first number, the SUM automagically updates too.
16
+
Se você colocar o número dois na primeira célula, e o número 3 na segunda e então utilizar o SUM, a planilha te dará o resultado. Nenhuma surpresa aqui. Mas se você atualizar o primeiro número, o SUM é automagicamente atualizado.
17
17
18
-
JavaScript doesn’t usually work like this -- If we were to write something comparable in JavaScript:
18
+
O JavaScript, geralmente, não funciona assim -- Se escrevêssemos algo semelhante em Javascript:
19
19
20
20
```js
21
21
var val1 =2
@@ -31,13 +31,13 @@ val1 = 3
31
31
// 5
32
32
```
33
33
34
-
If we update the first value, the sum is not adjusted.
34
+
Se atualizarmos o primeiro valor, a soma não é ajustada.
35
35
36
-
So how would we do this in JavaScript?
36
+
Então como fazemos isso em JavaScript?
37
37
38
-
-Detect when there’s a change in one of the values
39
-
-Track the function that changes it
40
-
-Trigger the function so it can update the final value
38
+
-Detecte quando há uma mudança em algum dos valores
39
+
-Rastreie a função que o modifica
40
+
-Dispare a função de modo que ela possa atualizar o valor final
0 commit comments