说来话长,不如你去看一下我为 vuejs.org 贡献的 pull request:
https://github.com/vuejs/vuej...
该 pr 主要分为三部分——
关于 el 的:
If neither render function nor template option is present, the in-DOM HTML of the mounting DOM element will be extracted as the template. In this case, Runtime + Compiler build of Vue should be used.
关于 template 的:
If render function is present in the Vue option, the template will be ignored.
关于 render 的:
The render function has priority over the render function compiled from template option or in-DOM HTML template of the mounting element which is specified by the el option.
官网中文版也有翻译。
之所以添加该部分内容,是因为 https://segmentfault.com/q/10... 这个问题
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…