1.代碼
<script src="https://unpkg.com/vue@next" rel="external nofollow" ></script>
<div id="bind-attribute">
<span v-bind:title="message">
鼠標懸停幾秒鐘查看此處動態(tài)綁定的提示信息!
</span>
</div>
<script>
const AttributeBinding = {
data() {
return {
message: 'You loaded this page on ' + new Date().toLocaleString()
}
}
}
Vue.createApp(AttributeBinding).mount('#bind-attribute')
</script>
2.運行結果
文章來源:http://www.zghlxwxcb.cn/news/detail-675693.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-675693.html
到了這里,關于vue 簡單實驗 v-bind 變量與html屬性綁定的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!