You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
764 B
34 lines
764 B
2 years ago
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Vue模板语法</title>
|
||
|
<script type="text/javascript" src="../vue.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="root">
|
||
|
<h1>插值语法</h1>
|
||
|
<h3>你好,{{name}}</h3>
|
||
|
<hr>
|
||
|
<h1>指令语法</h1>
|
||
|
<a v-bind:href="school.url">{{school.name.toUpperCase()}}</a>
|
||
|
<br>
|
||
|
<a :href="school.url">{{school.name}}</a>
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
Vue.config.productionTip = false;
|
||
|
const x = new Vue({
|
||
|
el: '#root',
|
||
|
data: {
|
||
|
user: {
|
||
|
name: 'Roger'
|
||
|
},
|
||
|
school: {
|
||
|
name: 'leying',
|
||
|
url: 'http://www.baidu.com'
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|