<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- 开发环境版本,包含了有帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
{{msg}}
<p v-if="flag">动态绑定:flag为true显示,flag为假不显示,条件</p>
<ul>
<li v-for="num in a">
<!-- 循环 插入表达式必须放在所在的div里-->
{{num}}
</li>
</ul>
</div>
<script type="text/javascript">
var a=new Vue({
el: "#app",
data:{
msg:"hello Vue",
name:"aaa",
age:12,
a:[1,2,3],
flag:false
}
}
);
</script>
</body>
</html>
vue框架初始
最新推荐文章于 2024-11-15 19:58:47 发布