v-bind指令
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> .btn{ color: red; } </style> </head> <body> <div id="app"> <a v-bind:href="url" v-bind:class="{btn:isactive}">点我吧</a> </div> <script src="../lib/vue.js"></script> <script src="js/main.js"></script> </body> </html>
var app = new Vue({
el:"#app",
data:{
url:"http:baidu.com",
isactive:true,
}
})
本文来自博客园,作者:一石数字欠我15w!!!,转载请注明原文链接:https://www.cnblogs.com/52-qq/p/8386255.html