<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="myVue">
<!--反映组件数据-->
<mycomponent></mycomponent>
<yourcomponent></yourcomponent>
</div>
<script type="text/javascript">
new Vue({
//挂载节点
el:"#myVue",
//组件
components:{
//组件名字
"mycomponent":{
//组件数据
template:"<h1>局部组件</h1>"
},
//组件名字
"yourcomponent":{
//组件数据
template:"<h1>局部组件</h1>"
}
}
})
</script>
</body>
</html>
04-12
890