v-bind 例子
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
<img src="./imgs/10-02.png" alt="" title="hello 波仔">
<img v-bind:src="imgUrl" alt="" v-bind:title="msg">
<img :src="imgUrl" alt="" :title="msg">
<img src="./imgs/10-02.png" alt="">
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.14/vue.js"></script>
<script>
const app = new Vue({
el: '#app',
data: {
imgUrl: './imgs/10-02.png',
msg: 'Hello 波仔'
},
})
</script>
</body>
</html>
演示
文章来源:https://www.toymoban.com/news/detail-685064.html
文章来源地址https://www.toymoban.com/news/detail-685064.html
到了这里,关于v-bind 例子 冒号:的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!