Skip to content

Commit d930ae3

Browse files
author
Ludo237
committed
Added Hook init
Improved translation
1 parent f1ef75f commit d930ae3

File tree

1 file changed

+46
-36
lines changed

1 file changed

+46
-36
lines changed

src/api/index.md

+46-36
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Type: api
365365

366366
- **Restriction:** Only accepts `Funzione` when used in `Vue.extend()`.
367367

368-
- **Details:**
368+
- **Dettagli:**
369369

370370
The data oggetto for the Vue instance. Vue.js will recursively convert its properties into getter/setters to make it "reactive". **The oggetto must be plain**: native oggettos, existing getter/setters and protoTipo properties are ignored. It is not recommended to observe complex oggettos.
371371

@@ -401,7 +401,7 @@ Type: api
401401

402402
- **Tipo:** `Array | Oggetto`
403403

404-
- **Details:**
404+
- **Dettagli:**
405405

406406
A list/hash of attributes that are exposed to accept data from the parent component. It has a simple Array-based syntax and an alternative Oggetto-based syntax that allows advanced configurations such as Tipo checking, custom validation and Predefinito valores.
407407

@@ -433,7 +433,7 @@ Type: api
433433

434434
- **Tipo:** `Oggetto`
435435

436-
- **Details:**
436+
- **Dettagli:**
437437

438438
Computed properties to be mixed into the Vue instance. All getters and setters have their `this` context automatically bound to the Vue instance.
439439

@@ -472,7 +472,7 @@ Type: api
472472

473473
- **Tipo:** `Oggetto`
474474

475-
- **Details:**
475+
- **Dettagli:**
476476

477477
Methods to be mixed into the Vue instance. You can access these methods directly on the VM instance, or use them in directive expressions. All methods will have their `this` context automatically bound to the Vue instance.
478478

@@ -497,7 +497,7 @@ Type: api
497497

498498
- **Tipo:** `Oggetto`
499499

500-
- **Details:**
500+
- **Dettagli:**
501501

502502
An oggetto where chiaves are expressions to watch and valores are the corresponding callbacks. The valore can also be a stringa of a method name, or an Oggetto that contains additional opzioni. The Vue instance will call `$watch()` for each entry in the oggetto at instantiation.
503503

@@ -534,7 +534,7 @@ Type: api
534534

535535
- **Restriction:** only accepts Tipo `Funzione` when used in `Vue.extend()`.
536536

537-
- **Details:**
537+
- **Dettagli:**
538538

539539
Provide the Vue instance an existing DOM element to mount on. It can be a CSS selector stringa, an actual HTMLElement, or a function that returns an HTMLElement. Note that the provided element merely serves as a mounting point; it will be replaced if a template is also provided, unless `replace` is set to falso. The resolved element will be accessible as `vm.$el`.
540540

@@ -548,7 +548,7 @@ Type: api
548548

549549
- **Tipo:** `Stringa`
550550

551-
- **Details:**
551+
- **Dettagli:**
552552

553553
A stringa template to be used as the markup for the Vue instance. By Predefinito, the template will **replace** the mounted element. When the `replace` option is set to `falso`, the template will be inserted into the mounted element instead. In both cases, any existing markup inside the mounted element will be ignored, unless content distribution slots are present in the template.
554554

@@ -569,7 +569,7 @@ Type: api
569569

570570
- **Restriction:** only respected if the **template** option is also present.
571571

572-
- **Details:**
572+
- **Dettagli:**
573573

574574
Determines whether to replace the element being mounted on with the template. If set to `falso`, the template will overwrite the element's inner content without replacing the element itself.
575575

@@ -616,11 +616,21 @@ Type: api
616616

617617
## Options / Lifecycle Hooks
618618

619+
### init
620+
621+
- **Tipo:** `Funzione`
622+
623+
- **Dettagli:**
624+
625+
Called synchronously after the instance has already been initialized, but not has started processing the options and the data for set up the scope.
626+
627+
- **Vedi anche:** [Diagramma del Ciclo di Vita](/guide/instance.html#Lifecycle_Diagram)
628+
619629
### created
620630

621631
- **Tipo:** `Funzione`
622632

623-
- **Details:**
633+
- **Dettagli:**
624634

625635
Called synchronously after the instance is created. At this stage, the instance has finished processing the opzioni which means the following have been set up: data observation, computed properties, methods, watch/event callbacks. However, DOM compilation has not been started, and the `$el` property will not be available yet.
626636

@@ -630,7 +640,7 @@ Type: api
630640

631641
- **Tipo:** `Funzione`
632642

633-
- **Details:**
643+
- **Dettagli:**
634644

635645
Called right before the compilation starts.
636646

@@ -640,7 +650,7 @@ Type: api
640650

641651
- **Tipo:** `Funzione`
642652

643-
- **Details:**
653+
- **Dettagli:**
644654

645655
Called after the compilation is finished. At this stage all directives have been linked so data changes will trigger DOM updates. However, `$el` is not guaranteed to have been inserted into the document yet.
646656

@@ -650,7 +660,7 @@ Type: api
650660

651661
- **Tipo:** `Funzione`
652662

653-
- **Details:**
663+
- **Dettagli:**
654664

655665
Called after compilation **and** the `$el` is **inserted into the document for the first time**, i.e. right after the first `attached` hook. Note this insertion must be executed via Vue (with methods like `vm.$appendTo()` or as a result of a directive update) to trigger the `ready` hook.
656666

@@ -660,23 +670,23 @@ Type: api
660670

661671
- **Tipo:** `Funzione`
662672

663-
- **Details:**
673+
- **Dettagli:**
664674

665675
Called when `vm.$el` is attached to DOM by a directive or a VM instance method such as `$appendTo()`. Direct manipulation of `vm.$el` will **not** trigger this hook.
666676

667677
### detached
668678

669679
- **Tipo:** `Funzione`
670680

671-
- **Details:**
681+
- **Dettagli:**
672682

673683
Called when `vm.$el` is removed from the DOM by a directive or a VM instance method. Direct manipulation of `vm.$el` will **not** trigger this hook.
674684

675685
### beforeDestroy
676686

677687
- **Tipo:** `Funzione`
678688

679-
- **Details:**
689+
- **Dettagli:**
680690

681691
Called right before a Vue instance is destroyed. At this stage the instance is still fully functional.
682692

@@ -686,7 +696,7 @@ Type: api
686696

687697
- **Tipo:** `Funzione`
688698

689-
- **Details:**
699+
- **Dettagli:**
690700

691701
Called after a Vue instance has been destroyed. When this hook is called, all bindings and directives of the Vue instance have been unbound and all child Vue instances have also been destroyed.
692702

@@ -700,7 +710,7 @@ Type: api
700710

701711
- **Tipo:** `Oggetto`
702712

703-
- **Details:**
713+
- **Dettagli:**
704714

705715
A hash of directives to be made available to the Vue instance.
706716

@@ -712,7 +722,7 @@ Type: api
712722

713723
- **Tipo:** `Oggetto`
714724

715-
- **Details:**
725+
- **Dettagli:**
716726

717727
A hash of element directives to be made available to the Vue instance.
718728

@@ -724,7 +734,7 @@ Type: api
724734

725735
- **Tipo:** `Oggetto`
726736

727-
- **Details:**
737+
- **Dettagli:**
728738

729739
A hash of filters to be made available to the Vue instance.
730740

@@ -736,7 +746,7 @@ Type: api
736746

737747
- **Tipo:** `Oggetto`
738748

739-
- **Details:**
749+
- **Dettagli:**
740750

741751
A hash of components to be made available to the Vue instance.
742752

@@ -747,7 +757,7 @@ Type: api
747757

748758
- **Tipo:** `Oggetto`
749759

750-
- **Details:**
760+
- **Dettagli:**
751761

752762
A hash of transitions to be made available to the Vue instance.
753763

@@ -758,7 +768,7 @@ Type: api
758768

759769
- **Tipo:** `Oggetto`
760770

761-
- **Details:**
771+
- **Dettagli:**
762772

763773
A hash of partial stringas to be made available to the Vue instance.
764774

@@ -771,7 +781,7 @@ Type: api
771781

772782
- **Tipo:** `Vue instance`
773783

774-
- **Details:**
784+
- **Dettagli:**
775785

776786
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.
777787

@@ -781,7 +791,7 @@ Type: api
781791

782792
- **Tipo:** `Oggetto`
783793

784-
- **Details:**
794+
- **Dettagli:**
785795

786796
An oggetto where chiaves are events to listen for and valores are the corresponding callbacks. Note these are Vue events rather than DOM events. The valore can also be a stringa of a method name. The Vue instance will call `$on()` for each entry in the oggetto at instantiation.
787797

@@ -817,7 +827,7 @@ Type: api
817827

818828
- **Tipo:** `Array`
819829

820-
- **Details:**
830+
- **Dettagli:**
821831

822832
The `mixins` option accepts an array of mixin oggettos. These mixin oggettos can contain instance opzioni just like normal instance oggettos, and they will be merged against the eventual opzioni 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.
823833

@@ -845,7 +855,7 @@ Type: api
845855

846856
- **Restriction:** only respected when used in `Vue.extend()`.
847857

848-
- **Details:**
858+
- **Dettagli:**
849859

850860
Allow the component to recursively invoke itself in its template. Note that when a component is registraed globally with `Vue.component()`, the global ID is automatically set as its name.
851861

@@ -876,7 +886,7 @@ Type: api
876886

877887
- **Tipo:** `Oggetto`
878888

879-
- **Details:**
889+
- **Dettagli:**
880890

881891
The data oggetto that the Vue instance is observing. You can swap it with a new oggetto. The Vue instance proxies access to the properties on its data oggetto.
882892

@@ -886,7 +896,7 @@ Type: api
886896

887897
- **Read only**
888898

889-
- **Details:**
899+
- **Dettagli:**
890900

891901
The DOM element that the Vue instance is managing. Note that for [Fragment Instances](/guide/components.html#Fragment_Instance), `vm.$el` will return an anchor node that indicates the starting position of the fragment.
892902

@@ -896,7 +906,7 @@ Type: api
896906

897907
- **Read only**
898908

899-
- **Details:**
909+
- **Dettagli:**
900910

901911
The instantiation opzioni used for the current Vue instance. This is useful when you want to include custom properties in the opzioni:
902912

@@ -915,7 +925,7 @@ Type: api
915925

916926
- **Read only**
917927

918-
- **Details:**
928+
- **Dettagli:**
919929

920930
The parent instance, if the current instance has one.
921931

@@ -925,7 +935,7 @@ Type: api
925935

926936
- **Read only**
927937

928-
- **Details:**
938+
- **Dettagli:**
929939

930940
The root Vue instance of the current component tree. If the current instance has no parents this valore will be itself.
931941

@@ -935,7 +945,7 @@ Type: api
935945

936946
- **Read only**
937947

938-
- **Details:**
948+
- **Dettagli:**
939949

940950
The direct child components of the current instance.
941951

@@ -945,7 +955,7 @@ Type: api
945955

946956
- **Read only**
947957

948-
- **Details:**
958+
- **Dettagli:**
949959

950960
An oggetto that holds child components that have `v-ref` registraed.
951961

@@ -959,7 +969,7 @@ Type: api
959969

960970
- **Read only**
961971

962-
- **Details:**
972+
- **Dettagli:**
963973

964974
An oggetto that holds DOM elements that have `v-el` registraed.
965975

@@ -1423,7 +1433,7 @@ Type: api
14231433

14241434
- **Expects:** `Stringa`
14251435

1426-
- **Details:**
1436+
- **Dettagli:**
14271437

14281438
Updates the element's `textContent`.
14291439

@@ -1441,7 +1451,7 @@ Type: api
14411451

14421452
- **Expects:** `Stringa`
14431453

1444-
- **Details:**
1454+
- **Dettagli:**
14451455

14461456
Updates the element's `innerHTML`. The contents are inserted as plain HTML - data bindings are ignored. If you need to reuse template pieces, you should use [partials](#partial).
14471457

0 commit comments

Comments
 (0)