vue v-bind v-on

v-bind绑定属性不需要加""{{}}""

可简写为一个":"

<input type="" name="" :value="msg" :title='msg'>

 

 

<input type="" name="" v-bind:value="msg" v-bind:title='msg'>

 


也可以加拼接字符串

<input type="" name="" v-bind:value="msg" v-bind:title="msg+'1222'">

                 两个变量拼接   

<input type="" name="" v-bind:value="msg+msgs" v-bind:title='msg'>

               简写@:click

<input type="button" name="" v-on:click='show'>

<script type="text/javascript">
var vm = new Vue({
el:'#app',
data:{
'msg':'程逢s池',
'msgs':'msg',
},
methods:{
show:function(){
alert(11)
}
}
})
</script>

posted @ 2019-08-11 22:03  酷酷的城池  阅读(849)  评论(0编辑  收藏  举报