vue 常用指令

v-text

{{name}}

v-html

{{{html}}}

v-model

123showModel

v-show

hello world

Ok

v-if

hello

world

Ok

v-bind:style

hello world

v-for

{{arr.name}}

v-bind:

{{url}}{{url}}

red

red

Ok

{{name}}

.red{

color: red;

}

v-on:

testtest

var data = {el: '#demo',data: {name: 'yao',html: '

123456

',inp: '',sel: '',tex: '',bool: false,size: 20,bool2: false,bool3:true,arrs: [{name: 'yao'}, {name: 'xie'}, {name: 'lan'}],url: 'img/1.jpg'},methods: {showModel: function() {this.test();console.log(this);console.log(this.inp, this.sel, this.tex);},test: function() {console.log('test')},t: function() {console.log('t')}},ready: function() {this.t();}}var demo = new Vue(data);/*console.log(demo)demo.t();*/

你可能感兴趣的:(vue 常用指令)