Vue instruction learning and vue instruction

Source: Internet
Author: User

Vue instruction learning and vue instruction

# New Vue ({All vue data is stored in data # data: {vue object data # a: 1, object # B: [], #}# methods: {vue object method # dosomthing: function () # {# this. a ++ # console. log (this. a) #}##}# watch: {vue object listener # 'A': function (val, oldVal) {# console. log (val, oldVal) ##}###}) # Data Rendering v-text, v-html, {{}# <p >{{ a }}</p> a # <p v-text = "a"> </p> # <p v -html = "a"> </p> html stores the html structure # Here, a corresponds to a in the Vue data source # the control module hides v-if, v-show, # <p v-if = "isShow"> </p> # <p v-show = "isShow"> </p> # new Vue ({# data: {# isShow: true, #}#}) # difference if this dom element show is not rendered through the display of css: none hides the element # rendering loop list v-for # <ul> # <li v-for = "item in items" >#< p v-text = "item. label "> </p> # </li> # </ul> # data: {# items: [# {label: 'apple'}, # {label: 'banana '}, #] #}# event binding v-on # <button v-on: click = "doThis"> </button> # <button @ click = "doThis"> </button> # methods :{# doThis: function (something) {##}#}# property binding: v-bind # #< div: class = "{red: isRed} "> </div> # <div: class =" [classA, classB] "> </div> # <div: class =" [classA, {classB: isB, classC: isC] "> </div>

  

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.