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/api/effect-scope.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
-
# Effect Scope API <Badgetext="3.2+" />
1
+
# API do Escopo de Efeito <Badgetext="3.2+" />
2
2
3
3
:::info
4
-
Effect scope is an advanced API primarily intended for library authors. For details on how to leverage this API, please consult its corresponding [RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0041-reactivity-effect-scope.md).
4
+
Escopo de efeito é uma API avançada destinada principalmente a autores de bibliotecas. Para obter detalhes sobre como aproveitar essa API, consulte o [RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0041-reactivity-effect-scope.md) correspondente.
5
5
:::
6
6
7
7
## `effectScope`
8
8
9
-
Creates an effect scope object which can capture the reactive effects (e.g. computed and watchers) created within it so that these effects can be disposed together.
9
+
Cria um objeto de escopo de efeito que pode capturar os efeitos reativos (por exemplo, computados e observadores) criados dentro dele para que esses efeitos possam ser descartados juntos.
10
10
11
-
**Typing:**
11
+
**Tipando:**
12
12
13
13
```ts
14
14
function effectScope(detached?:boolean):EffectScope
15
15
16
16
interfaceEffectScope {
17
-
run<T>(fn: () =>T):T|undefined//undefined if scope is inactive
17
+
run<T>(fn: () =>T):T|undefined//indefinido se o escopo estiver inativo
Thismethodcanbeusedasanon-component-coupledreplacementof`onUnmounted`inreusablecompositionfunctions, sinceeachVuecomponent's `setup()` function is also invoked in an effect scope.
53
+
Estemétodopodeserusadocomoumsubstitutode`onUnmounted`"não acoplado a componentes"emfunçõesdecomposiçãoreutilizáveis, umavezqueafunção`setup()`decadacomponenteVuetambém é invocadaemumescopodeefeito.
0 commit comments