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,
    }
})

 

posted @ 2018-01-30 17:35  一石数字欠我15w!!!  阅读(209)  评论(0编辑  收藏  举报