vue.js代码006

时间:2023-02-25 11:57:26


t006.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>t002</title>
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div >
<h1>插值语法</h1>
<h2>你好,{{name}}</h2>
<hr>
<h1>指令语法</h1>
<a v-bind:href="url">前往百度</a>
<a :href="url2">前往网易</a>
</div>

<script type="text/javascript">
Vue.config.productionTip = false;

new Vue({
el:'#root',
data:{
name:'虾米大王',
url:"http://www.baidu.com",
url2:'http://www.163.com'
}
});

</script>
</body>
</html>