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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM