原文链接:https://www.cnblogs.com/MrFlySand/p/16921017.html
02vue的安装
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="vue3.js"></script>
</head>
<!-- vue语法,告诉vue,这里放了一个变量,2个{}表示变量 -->
<div id="counter">
<p>{{id}}</p>
<p>{{name}}</p>
</div>
<div class="counter">
<p>QQ</p>
<P>{{num}}</P>
</div>
<body>
<script>
const Counter = { //配置方法
data: function() {
return {
id: "公众号",
name: "小知识酷",
num: 2602629626,
}
}
}
Vue.createApp(Counter).mount("#counter"); //创建应用,将配置对象传入
Vue.createApp(Counter).mount(".counter");
</script>
</body>
</html>
标签:教程,vue,createApp,Counter,Vue,num,详细,id
From: https://www.cnblogs.com/MrFlySand/p/16921017.html