Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 19fc36d

Browse files
panietoarmiljan-aleksic
authored andcommittedOct 6, 2017
Section Options (#24)
1 parent 84e16c6 commit 19fc36d

File tree

1 file changed

+97
-97
lines changed

1 file changed

+97
-97
lines changed
 

‎src/v2/api/index.md

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -594,193 +594,193 @@ type: api
594594
- **Vea También:**
595595
- [Funciones de renderizado](../guide/render-function)
596596

597-
## Options / Lifecycle Hooks
597+
## Opciones / Hooks de ciclo de vida
598598

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.
600600

601601
### beforeCreate
602602

603-
- **Type:** `Function`
603+
- **Tipo:** `Function`
604604

605-
- **Details:**
605+
- **Detalles:**
606606

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.
608608

609-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
609+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
610610

611611
### created
612612

613-
- **Type:** `Function`
613+
- **Tipo:** `Function`
614614

615-
- **Details:**
615+
- **Detalles:**
616616

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.
618618

619-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
619+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
620620

621621
### beforeMount
622622

623-
- **Type:** `Function`
623+
- **Tipo:** `Function`
624624

625-
- **Details:**
625+
- **Detalles:**
626626

627-
Called right before the mounting begins: the `render` function is about to be called for the first time.
627+
Llamado justo después que la fase de montaje inicia: la función `render` será llamada a continuación por primera vez.
628628

629-
**This hook is not called during server-side rendering.**
629+
**Este hook no es llamado durante renderización en servidor.**
630630

631-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
631+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
632632

633633
### mounted
634634

635-
- **Type:** `Function`
635+
- **Tipo:** `Function`
636636

637-
- **Details:**
637+
- **Detalles:**
638638

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.
640640

641-
**This hook is not called during server-side rendering.**
641+
**Este hook no es llamado durante renderización en servidor.**
642642

643-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
643+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
644644

645645
### beforeUpdate
646646

647-
- **Type:** `Function`
647+
- **Tipo:** `Function`
648648

649-
- **Details:**
649+
- **Detalles:**
650650

651-
Called when the data changes, before the virtual DOM is re-rendered and patched.
651+
Llamado cuando los datos cambian, antes que el DOM virtual sea re-renderizado y parchado.
652652

653-
You can perform further state changes in this hook and they will not trigger additional re-renders.
653+
Puede realizar cambios de estado adicionales en este hook, esto no activará re-renderizados adicionales.
654654

655-
**This hook is not called during server-side rendering.**
655+
**Este hook no es llamado durante renderización en servidor.**
656656

657-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
657+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
658658

659659
### updated
660660

661-
- **Type:** `Function`
661+
- **Tipo:** `Function`
662662

663-
- **Details:**
663+
- **Detalles:**
664664

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.
666666

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.
668668

669-
**This hook is not called during server-side rendering.**
669+
**Este hook no es llamado durante renderización en servidor.**
670670

671-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
671+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
672672

673673
### activated
674674

675-
- **Type:** `Function`
675+
- **Tipo:** `Function`
676676

677-
- **Details:**
677+
- **Detalles:**
678678

679-
Called when a kept-alive component is activated.
679+
Llamado cuando un componente a mantener vivo es activado.
680680

681-
**This hook is not called during server-side rendering.**
681+
**Este hook no es llamado durante renderización en servidor.**
682682

683683
- **Vea También:**
684-
- [Built-in Components - keep-alive](#keep-alive)
685-
- [Dynamic Components - keep-alive](../guide/components.html#keep-alive)
684+
- [Componentes construídos - keep-alive](#keep-alive)
685+
- [Componentes dinámicos - keep-alive](../guide/components.html#keep-alive)
686686

687687
### deactivated
688688

689-
- **Type:** `Function`
689+
- **Tipo:** `Function`
690690

691-
- **Details:**
691+
- **Detalles:**
692692

693-
Called when a kept-alive component is deactivated.
693+
Llamado cuando un componente a mantener vivo es desactivado.
694694

695-
**This hook is not called during server-side rendering.**
695+
**Este hook no es llamado durante renderización en servidor.**
696696

697697
- **Vea También:**
698-
- [Built-in Components - keep-alive](#keep-alive)
699-
- [Dynamic Components - keep-alive](../guide/components.html#keep-alive)
698+
- [Componentes construídos - keep-alive](#keep-alive)
699+
- [Componentes dinámicos - keep-alive](../guide/components.html#keep-alive)
700700

701701
### beforeDestroy
702702

703-
- **Type:** `Function`
703+
- **Tipo:** `Function`
704704

705-
- **Details:**
705+
- **Detalles:**
706706

707-
Called right before a Vue instance is destroyed. At this stage the instance is still fully functional.
707+
Llamado justo antes que una instancia Vue sea destruída. En este punto la instancia es todavía completamente funcional.
708708

709-
**This hook is not called during server-side rendering.**
709+
**Este hook no es llamado durante renderización en servidor.**
710710

711-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
711+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
712712

713713
### destroyed
714714

715-
- **Type:** `Function`
715+
- **Tipo:** `Function`
716716

717-
- **Details:**
717+
- **Detalles:**
718718

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.
720720

721-
**This hook is not called during server-side rendering.**
721+
**Este hook no es llamado durante renderización en servidor.**
722722

723-
- **Vea También:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram)
723+
- **Vea También:** [Diagrama de ciclo de vida](../guide/instance.html#Diagrama-de-ciclo-de-vida)
724724

725-
## Options / Assets
725+
## Opciones / Recursos
726726

727727
### directives
728728

729-
- **Type:** `Object`
729+
- **Tipo:** `Object`
730730

731-
- **Details:**
731+
- **Detalles:**
732732

733-
A hash of directives to be made available to the Vue instance.
733+
Un objeto de directivas para poner a disposición de la instancia Vue.
734734

735735
- **Vea También:**
736-
- [Custom Directives](../guide/custom-directive.html)
737-
- [Assets Naming Convention](../guide/components.html#Assets-Naming-Convention)
736+
- [Directivas Personalizadas](../guide/custom-directive.html)
737+
- [Convenciones para Nombramiento de Recursos](../guide/components.html#Convenciones-para-Nombramiento-de-Componentes)
738738

739739
### filters
740740

741-
- **Type:** `Object`
741+
- **Tipo:** `Object`
742742

743-
- **Details:**
743+
- **Detalles:**
744744

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.
746746

747747
- **Vea También:**
748748
- [`Vue.filter`](#Vue-filter)
749749

750750
### components
751751

752-
- **Type:** `Object`
752+
- **Tipo:** `Object`
753753

754-
- **Details:**
754+
- **Detalles:**
755755

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.
757757

758758
- **Vea También:**
759759
- [Components](../guide/components.html)
760760

761-
## Options / Misc
761+
## Opciones / Misceláneos
762762

763763
### parent
764764

765-
- **Type:** `Vue instance`
765+
- **Tipo:** `Vue instance`
766766

767-
- **Details:**
767+
- **Detalles:**
768768

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.
770770

771-
<p class="tip">Use `$parent` and `$children` sparringly - they mostly serve as an escape-hatch. Prefer using props and events for parent-child communication.</p>
771+
<p class="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>
772772

773773
### mixins
774774

775-
- **Type:** `Array<Object>`
775+
- **Tipo:** `Array<Object>`
776776

777-
- **Details:**
777+
- **Detalles:**
778778

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.
780780

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.
782782

783-
- **Example:**
783+
- **Ejemplo:**
784784

785785
``` js
786786
var mixin = {
@@ -798,32 +798,32 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
798798

799799
### name
800800

801-
- **Type:** `string`
801+
- **Tipo:** `string`
802802

803-
- **Restriction:** only respected when used as a component option.
803+
- **Restricción:** únicamente respetado cuando se usa como opción de componente.
804804

805-
- **Details:**
805+
- **Detalles:**
806806

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.
808808

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.
810810

811811
### extends
812812

813-
- **Type:** `Object | Function`
813+
- **Tipo:** `Object | Function`
814814

815-
- **Details:**
815+
- **Detalles:**
816816

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.
818818

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.
820820

821-
- **Example:**
821+
- **Ejemplo:**
822822

823823
``` js
824824
var CompA = { ... }
825825

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
827827
var CompB = {
828828
extends: CompA,
829829
...
@@ -832,33 +832,33 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
832832

833833
### delimiters
834834

835-
- **Type:** `Array<string>`
835+
- **Tipo:** `Array<string>`
836836

837-
- **default:** `{% raw %}["{{", "}}"]{% endraw %}`
837+
- **Valor por defecto:** `{% raw %}["{{", "}}"]{% endraw %}`
838838

839-
- **Details:**
839+
- **Detalles:**
840840

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.**
842842

843-
- **Example:**
843+
- **Ejemplo:**
844844

845845
``` js
846846
new Vue({
847847
delimiters: ['${', '}']
848848
})
849849

850-
// Delimiters changed to ES6 template string style
850+
// Delimitadores cambiados al estilo de plantillas string de ES6
851851
```
852852

853853
### functional
854854

855-
- **Type:** `boolean`
855+
- **Tipo:** `boolean`
856856

857-
- **Details:**
857+
- **Detalles:**
858858

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.
860860

861-
- **Vea También:** [Functional Components](../guide/render-function.html#Functional-Components)
861+
- **Vea También:** [Componentes funcionales](../guide/render-function.html#Componentes-Funcionales)
862862

863863
## Instance Properties
864864

0 commit comments

Comments
 (0)
Please sign in to comment.