Vue模版语法
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>模版语法title>
<script type="text/javascript" src="../js/vue.js">script>
head>
<body>
<div id="root">
<h2>插值语法h2>
<h4>你好{{msg}}h4>
<h4>你好{{msg.toUpperCase()}}h4>
<hr />
<h2>指令语法h2>
<a :href="url">点我去学习a>
<a href="http://www.baidu.com" :x="msg">点我去学习a>
div>
<script>
new Vue({
el: "#root",
data: {
msg: "atguigu",
url: "https://www.baidu.com",
},
});
script>
body>
html>
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42