Vue笔记——v-bind用于绑定数据或元素属性

HTML
<head>
< style >
. active {
background : #a10;
}
< / style >
head >

< body >
< div id =" app ">
< a v-bind: class =" {active: isActive} " : href =" url ">YO. a > //v-bind简写为
div >
< script src =" ../lib/Vue.js "> < / script >
< script src =" ../18.3/main.js "> < / script >
body >
JS
var app = new Vue({
el : ' #app ',
data : {
url : ' http://www.baidu.com ',
isActive : true,
}
}) ;

你可能感兴趣的:(Vue)