image.png

代码

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据绑定-使用v-bind指令绑定HTML属性值和参数的使用</title>
    <script src="https://static.gzj2001.com/vue/vue.js"></script>
</head>
<body>
    <div id="app">
     <a href="//www.gzj2001.com">城南花开</a>
     <hr>
     <a v-bind:href="url" v-bind:target="target">去博客</a>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                url:"//www.cnhk.pro",
                target:"_blank"
            }
        })
    </script>
</body>
</html>