A summary of Vue.js's study

Source: Internet
Author: User

I. Introduction to Vue.js

Vue.js is a set of progressive frameworks for building user interfaces. Specific introduction to the official introduction, https://cn.vuejs.org/v2/guide/.

second, the use of Vue.js learning summary

1. V-model creates a two-way binding on a form control or component. Varies depending on the type of form control. However, in addition to the form can not use two-way binding, for example, the table label can not use V-model for two-way binding, can only let the data from the background to the foreground one-way transmission, showing the use of double curly braces.

2. The custom method after creating the Vue object needs to be written in methods, and the method supports $.get () and $.ajax ().

3, multi-select, such as the data in the Vue object to create a student variable, the initial value of the variable is generally set to NULL, we also set the initial value of student to NULL, as well as the students array variable, the array is an object member, as follows.

students:[
{text: ' Study number ', Value: ' 0 '},//number
{text: ' name ', Value: ' 1 '},//name
{text: ' Age ', Value: ' 2 '},//age
{text: ' Gender ', Value: ' 3 '},//sex
{text: ' Class ', Value: ' 4 '},//class
{text: ' Faculties ', Value: ' 5 '},//faculties
{text: ' School ', Value: ' 6 '},//School
{text: ' Condition not limited ', value:null}
]

This can be written on the page.

<select id= "Students" v-model= "student" >
<option v-for= "Item in students": value= "Item.value" >
{{Item.text}}
</option>
</select>

Show.

Since the initial value of the student is NULL, the default is no limit to the selected condition. For example, when we choose the study number, Item.value value is 0, where item is my own definition, you can also write according to their own habits, such as ele and so on. The 0 value is assigned to the student through V-model, which enables two-way binding of the data. Here we simply understand what is the two-way binding of data. To get a deeper understanding of vue.js, I suggest learning more about official documents.

A summary of Vue.js's study

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.