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/v2/api/index.md
+97-97Lines changed: 97 additions & 97 deletions
Original file line number
Diff line number
Diff line change
@@ -594,193 +594,193 @@ type: api
594
594
-**Vea También:**
595
595
-[Funciones de renderizado](../guide/render-function)
596
596
597
-
## Options / Lifecycle Hooks
597
+
## Opciones / Hooks de ciclo de vida
598
598
599
-
All lifecycle hooks automatically have their `this` context bound to the instance, so that you can access data, computed properties, and methods. This means __you should not use an arrow function to define a lifecycle method__ (e.g.`created: () => this.fetchTodos()`). The reason is arrow functions bind the parent context, so `this`will not be the Vue instance as you expect and `this.fetchTodos`will be undefined.
599
+
Todos los hooks de ciclo de vida tienen la instancia asignada automáticamente a su contexto `this`, de modo que usted puede acceder a los datos, a las propiedades calculadas, y a los métodos. Esto quiere decir __que usted no debe usar funciones flecha para definir un método de ciclo de vida__ (p.e.`created: () => this.fetchTodos()`). La razón es que las funciones flecha asignan el contexto padre a `this`, de modo que `this`no será la instancia Vue como se esperaría y `this.fetchTodos`no estará definido.
600
600
601
601
### beforeCreate
602
602
603
-
-**Type:**`Function`
603
+
-**Tipo:**`Function`
604
604
605
-
-**Details:**
605
+
-**Detalles:**
606
606
607
-
Called synchronously after the instance has just been initialized, before data observation and event/watcher setup.
607
+
Llamado síncronamente justo después que la instacia es inicializada, antes de la observación de datos y la preparación de eventos/observadores.
-**Vea También:**[Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
610
610
611
611
### created
612
612
613
-
-**Type:**`Function`
613
+
-**Tipo:**`Function`
614
614
615
-
-**Details:**
615
+
-**Detalles:**
616
616
617
-
Called synchronously after the instance is created. At this stage, the instance has finished processing the options which means the following have been set up: data observation, computed properties, methods, watch/event callbacks. However, the mounting phase has not been started, and the `$el`property will not be available yet.
617
+
Llamado síncronamente después que la instancia es creada. En este punto, la instancia ha finalizado de procesar las opciones, lo que significa que lo siguiente ha sido preparado: observación de datos, propiedades calculadas, métodos, callbacks de observación/eventos. Sin embargo, no se ha iniciado la fase de montaje, y la propiedad `$el`no estará disponible.
-**Vea También:**[Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
632
632
633
633
### mounted
634
634
635
-
-**Type:**`Function`
635
+
-**Tipo:**`Function`
636
636
637
-
-**Details:**
637
+
-**Detalles:**
638
638
639
-
Called after the instance has just been mounted where `el`is replaced by the newly created`vm.$el`. If the root instance is mounted to an in-document element, `vm.$el`will also be in-document when`mounted`is called.
639
+
Llamado después que la instancia acaba de ser montada donde `el`es reemplazado por el recién creado`vm.$el`. Si la instancia raíz es montada en un elemento en documento, `vm.$el`será también en documento cuando`mounted`sea llamado.
640
640
641
-
**This hook is not called during server-side rendering.**
641
+
**Este hook no es llamado durante renderización en servidor.**
-**Vea También:**[Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
658
658
659
659
### updated
660
660
661
-
-**Type:**`Function`
661
+
-**Tipo:**`Function`
662
662
663
-
-**Details:**
663
+
-**Detalles:**
664
664
665
-
Called after a data change causes the virtual DOM to be re-rendered and patched.
665
+
Llamado después que un cambio en datos causa que el DOM virtual sea re-renderizado y parchado.
666
666
667
-
The component's DOM will be in updated state when this hook is called, so you can perform DOM-dependent operations in this hook. However, in most cases you should avoid changing state in this hook, because it may lead to an infinite update loop.
667
+
El DOM del componente estará en un estado actualizado cuando este hook sea llamado, de modo que usted pueda realizar operaciones que dependan del DOM en este hook. Sin embargo, en la mayoría de casos usted debe evitar cambiar el estado en este hook, ya que puede conducir a un ciclo de actualizaciones infinito.
668
668
669
-
**This hook is not called during server-side rendering.**
669
+
**Este hook no es llamado durante renderización en servidor.**
-**Vea También:**[Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
712
712
713
713
### destroyed
714
714
715
-
-**Type:**`Function`
715
+
-**Tipo:**`Function`
716
716
717
-
-**Details:**
717
+
-**Detalles:**
718
718
719
-
Called after a Vue instance has been destroyed. When this hook is called, all directives of the Vue instance have been unbound, all event listeners have been removed, and all child Vue instances have also been destroyed.
719
+
Llamado después que una instancia Vue haya sido destruída. Cuando este hook es llamado, todas las directivas de la instancia Vue ya han sido desasignadas, todos los listeners de eventos han sido removidos, y todas las intancias Vue hijos también han sido destruídas.
720
720
721
-
**This hook is not called during server-side rendering.**
721
+
**Este hook no es llamado durante renderización en servidor.**
-[Convenciones para Nombramiento de Recursos](../guide/components.html#Convenciones-para-Nombramiento-de-Componentes)
738
738
739
739
### filters
740
740
741
-
-**Type:**`Object`
741
+
-**Tipo:**`Object`
742
742
743
-
-**Details:**
743
+
-**Detalles:**
744
744
745
-
A hash of filters to be made available to the Vue instance.
745
+
Un objeto de filtros para poner a disposición de la intancia Vue.
746
746
747
747
-**Vea También:**
748
748
-[`Vue.filter`](#Vue-filter)
749
749
750
750
### components
751
751
752
-
-**Type:**`Object`
752
+
-**Tipo:**`Object`
753
753
754
-
-**Details:**
754
+
-**Detalles:**
755
755
756
-
A hash of components to be made available to the Vue instance.
756
+
Un objeto de componentes para poner a dispocisión de la instancia Vue.
757
757
758
758
-**Vea También:**
759
759
-[Components](../guide/components.html)
760
760
761
-
## Options / Misc
761
+
## Opciones / Misceláneos
762
762
763
763
### parent
764
764
765
-
-**Type:**`Vue instance`
765
+
-**Tipo:**`Vue instance`
766
766
767
-
-**Details:**
767
+
-**Detalles:**
768
768
769
-
Specify the parent instance for the instance to be created. Establishes a parent-child relationship between the two. The parent will be accessible as `this.$parent`for the child, and the child will be pushed into the parent's `$children`array.
769
+
Especifica la instancia padre de la instancia a ser creada. Establece una relación padre-hijo entre ambas. El padre será accesible como `this.$parent`para el hijo, y el hijo será agregado al array `$children`del padre.
770
770
771
-
<pclass="tip">Use `$parent` and `$children` sparringly - they mostly serve as an escape-hatch. Prefer using props and events for parent-child communication.</p>
771
+
<pclass="tip">Use `$parent` con precaución - funciona principalmente como una compuerta de escape. Siempre prefiera usar props y eventos para comunicación entre padre e hijos.</p>
772
772
773
773
### mixins
774
774
775
-
-**Type:**`Array<Object>`
775
+
-**Tipo:**`Array<Object>`
776
776
777
-
-**Details:**
777
+
-**Detalles:**
778
778
779
-
The `mixins`option accepts an array of mixin objects. These mixin objects can contain instance options just like normal instance objects, and they will be merged against the eventual options using the same option merging logic in `Vue.extend()`. e.g. If your mixin contains a created hook and the component itself also has one, both functions will be called.
779
+
La opción `mixins`acepta un array de objetos mixin. Dichos objetos mixin pueden contener opciones de instancia tal como los objetos de instancia normales, y pueden ser integradas con las eventuales opciones usando la misma lógica de integración de opciones presente en `Vue.extend()`. p.e. Si su mixin contiene un hook `created` y el componente mismo tiene uno a su vez, ambas funciones serán llamadas.
780
780
781
-
Mixin hooks are called in the order they are provided, and called before the component's own hooks.
781
+
Los hooks en los mixins serán llamados en el mismo orden que fueron creados, y serán llamados antes de los propios hooks del componente.
782
782
783
-
-**Example:**
783
+
-**Ejemplo:**
784
784
785
785
```js
786
786
var mixin = {
@@ -798,32 +798,32 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
798
798
799
799
### name
800
800
801
-
-**Type:**`string`
801
+
-**Tipo:**`string`
802
802
803
-
-**Restriction:**only respected when used as a component option.
803
+
-**Restricción:**únicamente respetado cuando se usa como opción de componente.
804
804
805
-
-**Details:**
805
+
-**Detalles:**
806
806
807
-
Allow the component to recursively invoke itself in its template. Note that when a component is registered globally with `Vue.component()`, the global ID is automatically set as its name.
807
+
Permite al componente invocarse a sí mismo recursivamente en su plantilla. Tenga en cuenta que cuando un componente es registrado globalmente con `Vue.component()`, el ID global es asignado automáticamente como su nombre.
808
808
809
-
Another benefit of specifying a `name`option is debugging. Named components result in more helpful warning messages. Also, when inspecting an app in the [vue-devtools](https://github.com/vuejs/vue-devtools), unnamed components will show up as`<AnonymousComponent>`, which isn't very informative. By providing the `name` option, you will get a much more informative component tree.
809
+
Otro beneficio de especificar una opción `name`se presenta en la depuración. Usar componentes nombrados resulta en mensajes de advertencia más útiles. Tambien, cuando se inspecciona la aplicación con las [herramientas vue](https://github.com/vuejs/vue-devtools), los componentes sin nombre aparecerán como`<AnonymousComponent>`, lo cual no es muy informativo. Al proveer la opción `name`, obtendrá un árbol de componentes mucho más informativo.
810
810
811
811
### extends
812
812
813
-
-**Type:**`Object | Function`
813
+
-**Tipo:**`Object | Function`
814
814
815
-
-**Details:**
815
+
-**Detalles:**
816
816
817
-
Allows declaratively extending another component (could be either a plain options object or a constructor) without having to use`Vue.extend`. This is primarily intended to make it easier to extend between single file components.
817
+
Permite extender un componente de forma declarativa (ya sea unas opciones sencillas o un constructor) sin tener que usar`Vue.extend`. Esto se hace principalmente para facilitar la herencia entre componentes de un archivo.
818
818
819
-
This is similar to`mixins`, the difference being that the component's own options takes higher priority than the source component being extended.
819
+
Es similar a`mixins`, la diferencia siendo que que las propias opciones del componente toman una prioridad más alta que las del componente que está siendo extendido.
820
820
821
-
-**Example:**
821
+
-**Ejemplo:**
822
822
823
823
```js
824
824
var CompA = { ... }
825
825
826
-
//extend CompA without having to call Vue.extend on either
826
+
//extiende CompA sin tener que llamar Vue.extend en alguno de los dos
827
827
var CompB = {
828
828
extends: CompA,
829
829
...
@@ -832,33 +832,33 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
832
832
833
833
### delimiters
834
834
835
-
-**Type:**`Array<string>`
835
+
-**Tipo:**`Array<string>`
836
836
837
-
-**default:**`{% raw %}["{{", "}}"]{% endraw %}`
837
+
-**Valor por defecto:**`{% raw %}["{{", "}}"]{% endraw %}`
838
838
839
-
-**Details:**
839
+
-**Detalles:**
840
840
841
-
Change the plain text interpolation delimiters. **This option is only available in the standalone build.**
841
+
Cambia los delimitadores usados en la interpolación de texto. **Sólo disponible en la versión independiente.**
842
842
843
-
-**Example:**
843
+
-**Ejemplo:**
844
844
845
845
```js
846
846
newVue({
847
847
delimiters: ['${', '}']
848
848
})
849
849
850
-
//Delimiters changed to ES6 template string style
850
+
//Delimitadores cambiados al estilo de plantillas string de ES6
851
851
```
852
852
853
853
### functional
854
854
855
-
-**Type:**`boolean`
855
+
-**Tipo:**`boolean`
856
856
857
-
-**Details:**
857
+
-**Detalles:**
858
858
859
-
Causes a component to be stateless (no`data`) and instanceless (no `this` context). They are simply a `render`function that returns virtual nodes making them much cheaper to render.
859
+
Causa que un componente no tenga estado (sin`data`) y no tenga instancia (sin contexto `this`). Éste tipo de componente son sencillamente una función `render`que retorna nodos virtuales, haciéndolos mucho más económicos de renderizar.
0 commit comments