Files
ClassContent/历届学生/罗朝/2019-05-14/index.html
2024-09-27 02:06:13 +08:00

53 lines
1.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> Vue.js </title>
<script src="https://vuejs.org/js/vue.js"></script>
</head>
<body>
<!-- 所有的html代码都必须要包含在这个顶级父元素内部
view 层
-->
<div id="lb">
{{ names }}
{{age}}
<ul>
<li v-for="a in list">{{a.title}} {{a.id}}</li>
</ul>
</div>
<script>
// Vue 就是 vm
new Vue({
el: "#lb", // 告诉Vue你需要监听的页面顶级父元素的id
data: { // Vue开发中所有的变量基本上都放在data中 数据层 model
names: "刘兵",
age: 14,
list: [
{
id: 1,
title: '新闻1'
},
{
id: 2,
title: '新闻2'
},
{
id: 3,
title: '新闻3'
}
]
}
})
</script>
</body>
</html>