<!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>
</div>
<script type="text/javascript">
//定义全局组件
Vue.component("mycomponent",{
//组件数据
template:"<h1>全局组件</h1>"
})
//定义实例方法
new Vue({
//挂载节点
el:"#myVue"
})
</script>
</body>
</html>