主要区别就是完整版本比运行时版本多了将template转化为render函数的功能。会获取Vue原型上的$mount方法,然后重写它
-
首先会获取
Vue.prototype.$mount存储到变量mount里,然后重写Vue.prototype.$mount -
先获取el对象
-
判断el对象是否为body或者html,如果是直接返回Vue
-
然后判断是否存在
render选项,如果不存在 -
获取
template选项,判断template是字符串还是元素,最后拿到dom的innerHTML内容 -
拿到
innderHTML内容之后,调用compileToFunctions将template转为render函数 -
最后返回
mount.call(this, el, hydrating)渲染dom