鉴于官方的文档是es5的,但是使用vue-cli生成的代码模板是es6的,而且es6的模块化等也非常方便,以后肯定是主流。
1)定义简单组件 ItemTemplate.vue
<li>{{text}}li> template> <script> export default { props: ['text'], } script>
2)使用组件