<body>
<div id="app">
<diy></diy>
</div>
</body>
<template id="tmp">
<div>用Vue.extend构造器生成一个组件,并用实例$mount挂载上去</div>
</template>
var demo = Vue.extend({ template:`#tmp` }) new demo().$mount(‘diy‘)
原文:http://www.cnblogs.com/model-zachary/p/6947659.html