使用动态组件
| 1 | <component :is="currentView"></component> | 
组件的数据实始化使用function返回,否则无法初始化,如
| 1 2 3 4 5 6 | data :  function(){     return {         services : [],         msg : null     } } | 
状态改变的hook, 使用了route的组件,如果需要记得写router.activeate
| 1 2 3 | activate: function (done) {     done(); } | 
其它
数据(特别是复杂的对象)的改变尽量使用set函数或watch,如
| 1 | that.$set('services', rs); | 
| 1 2 3 4 5 | watch : {     api : {         deep: true     } } | 
使用computed属性来设置动态变量
| 1 2 3 4 5 6 7 8 9 | computed: {     isWelcome : function(){         return this.api.length > 0;     },     hasDoc : function(){         return this.func.doc.length > 0;     } } | 
在线编辑器
加载编辑器js等相关资源,在组件事件函数中渲染组件
官方文档说明:
http://rc.vuejs.org/guide/components.html#Component_Option_Caveats
http://vuejs.org/guide/components.html#activate_Hook