双向绑定v-bind
生活随笔
收集整理的這篇文章主要介紹了
双向绑定v-bind
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 通過v-model綁定輸出數據
- html部分
輸出結果:
嘗試改變輸入框里的內容:
結果:
- 綁定事件(注意methods和data的層級關系)
export default {
data()
{
return {
pagestyle:'https://v4.bootcss.com/docs/4.3/dist/css/bootstrap.css',
pagecss:'https://v4.bootcss.com/docs/4.3/examples/sticky-footer-navbar/sticky-footer-navbar.css',
mytitle:'v-bind bootstrap樣式測試頁',
msg:'教練檔案',
coachname:'勁兒弟弟'
}
},
methods: {
getmsg() {
alert(this.msg);
this.$refs.inforec.textContent=this.coachname+"的"+this.msg+"\n";
}
}
}
</script> ?
- html部分
?
?點擊確定后,
?
?
轉載于:https://www.cnblogs.com/saintdingspage/p/11414523.html
總結
以上是生活随笔為你收集整理的双向绑定v-bind的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql directx repair
- 下一篇: 分享适合程序员使用17 张壁纸