<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
</head>
<body>
<div id="root">
<h1>插值语法</h1>
<h3>你好,{{user.name}}</h3>
<hr>
<h1>指令语法</h1>
<!-- 在这里不能使用插值表达式的,但是可以用vue提供的v-bind:来绑定url或者缩写:来绑定 -->
<!-- <a v-bind:href="url.toUpperCase()">点我大写网址</a> -->
<a v-bind:href="url">我要看片</a>
<a :href="user.url">我要打游戏</a>
</div>
<script>
Vue.config.productionTip = false;
new Vue({
el: "#root",
data: {
user: {
name: "懒蛋",
hobby: "不干活",
url: "https://www.4399.com/"
},
url: "https://www.iqiyi.com/",
}
})
</script>
</body>
</html>