Vue. js uses custom commands to implement data pulling and updating

Source: Internet
Author: User
We believe that the data pulling and updating feature has been widely used. However, if we want to do this, we will not only learn how to do it, so this article will share with you the vue. js is implemented through custom commands. Read this article to understand vue. If you need it, let's take a look at it. Preface

The code snippet of this article is located in the single file component of vue, that is. in the file at the end of vue, this article describes only one implementation method. It is neither the only method nor the best method. If you have a better method, leave a message for discussion.

Step 1

First, you must first define the variables:

// App. vue script data () {return {// defines getData :{}, // defines the binding value of the custom command ifUpdate: true }}

Step 2

Then, to use ajax, introduce jquery in index.html so that you can use it globally:

// Index.html
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.