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