<!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=adge">
<title>Document</title>
<script src="vue.js"></script>
</head>
<body>
<div id="app">
<mycom3></mycom3>
</div>
<!-- 定义一个template标签元素 -->
<!-- 使用Vue提供的template标签,可以定义组件的UI模板结构 -->
<template id="tmpl">
<div>
<h1>我在外面定义的组件UI模板结构</h1>
<h1>我的外面必须要有唯一一个根元素存在</h1>
</div>
</template>
</body>
<script>
Vue.component("mycom3",{
template:"#tmpl"
})
//创建Vue实例,得到ViewModel
var vm=new Vue({
el:"#app",
data:{},
methods:{}
});
</script>
</html>