vue中v-bind绑定元素属性
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>vue.js</title>
</head>
<body>
<div id="app">
<h1 v-bind:title="msg" :dataid="num"></h1><br>
<a :href="link">www.forkliftpower.cn</a>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script>
var vm=new Vue({
el:'#app',
data:{
msg:'hello',
num:10,
link:'https://www.forkliftpower.cn',
}
})
</script>
</body>
</html>