官方文档与实际项目文档会有差别,实际项目中使用了

vue-loader
, 会自动加载所有的内容,按照webpacke + vue的约定.

官方文档是js文件

var Child = {
template: '
A custom component!
'
}
new Vue({
// ...
components: {
//  将只在父模板可用
'my-component': Child
}
})

实际项目是

<template>
....
</template>
<script>
.....
</script>
<style>
</style>