01-v-bind基本应用
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/vue.js" type="text/javascript" charset="UTF-8"></script>
<style type="text/css">
.abc{color: aquamarine;font-size: 20px;}
</style>
</head>
<body>
<div id="app">
<h1>1 动态绑定style属性的值:</h1>
<h2 v-bind:style="str">{{msg}}</h2>
<h1>2 动态绑定src属性的值</h1>
<img v-bind:src="imgsrc" v-bind:style="imgstyle">
<ul>
<li v-bind:style="ulstyle" v-for="item in movies">{{item}}</li>
</ul>
<h1>3 动态绑定href的属性值:</h1>
<a :href="bili">B站</a>
</div>
<script type="text/javascript">
const app=new Vue({
el:"#app",
data:{
msg:"我是xxxxx",
str:'color: aquamarine;font-size: 20px;',
imgsrc:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.doubanio.com%2Fview%2Frichtext%2Flarge%2Fpublic%2Fp196257303.jpg&refer=http%3A%2F%2Fimg2.doubanio.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1649754665&t=d89518826168d0a4254732d18cb6c9af',
imgstyle:'width:800px; height:600px; border:5px solid yellow',
movies:['西游记','大话西游','123','456'],
ulstyle:'color:#ff00cc',
bili:'https://www.bilibili.com/'
}
})
</script>
</body>
</html>