Describes the sequence of vue functions and vue functions.

Source: Internet
Author: User

Describes the sequence of vue functions and vue functions.

Method is used to define the method. For example, if you @ click = "test", methods defines the test method.

Both created and ready are the lifecycles of vue components.

Created

Type: Function

Details:

It is synchronously called after the instance is created. At this time, the instance resolution option has been completed, which means that data binding, calculation attributes, methods, watcher/Event Callback have been established. However, DOM compilation has not started yet, and $ el does not exist yet.

Ready

Type: Function

Details:

It is called after compilation and after el inserts the document for the first time, for example, after the first attached hook. Note that it must be inserted by Vue (for example, vm. el is called after the document is inserted for the first time, for example, after the first attached hook. Note that the ready hook must be triggered only when Vue is inserted (such as vm. appendTo () and other methods or command updates.

Compted is a computing attribute, such

Computed: {B: function () {return this. a + 1 }}

Then the value of B is linked to a, which is always equal to the value of a + 1. The value of a will change when it is modified.

Vue-resource is recommended for the ajax library of vue. Generally, a non-single-page application can obtain data in ready. If a single-page application obtains data based on the routing lifecycle, for example

Route: {data: function (transition) {// obtain data, modify data transition. next ()}}

The above introduction to the sequence of function calls in vue is all the content shared by Alibaba Cloud xiaobian. I hope to give you a reference and support for the help house.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.