字符串模板:
指的是在组件选项里用 template:"" 指定的模板,换句话说,写在 js 中的 template:"" 中的就是字符串模板。
比如下面这个:
var tmp = new Vue({
template:"<myComponent></myComponent>"
});
非字符串模板:
在单文件里用 <template></template> 指定的模板,换句话说,写在 html 中的就是非字符串模板。
指的是在组件选项里用 template:"" 指定的模板,换句话说,写在 js 中的 template:"" 中的就是字符串模板。
比如下面这个:
var tmp = new Vue({
template:"<myComponent></myComponent>"
});
在单文件里用 <template></template> 指定的模板,换句话说,写在 html 中的就是非字符串模板。