Dynamic Vuejs-带有动态模板(已编译)的Vue应用程序渲染方法引发了一些错误
我正在尝试构建一个vuejs仪表板,其模板是从ajax请求加载的 我的仪表板模板的示例结构如下Dynamic Vuejs-带有动态模板(已编译)的Vue应用程序渲染方法引发了一些错误,dynamic,vue.js,vue-component,Dynamic,Vue.js,Vue Component,我正在尝试构建一个vuejs仪表板,其模板是从ajax请求加载的 我的仪表板模板的示例结构如下 <div class="row"> <div class="col-sm-6"> <number-widget :option="option1"></number-widget> </div> </div> 好的,找出问题所在。我使用的是Vue.compile.render,应该是Vue.com
<div class="row">
<div class="col-sm-6">
<number-widget :option="option1"></number-widget>
</div>
</div>
好的,找出问题所在。我使用的是Vue.compile.render,应该是Vue.compile
不应该是这个吗。。这给了我参考错误:_m不是定义错误啊,你完全正确,应该是这样的。thnx@Ohgodwhy作为提示,得到了问题。
var vDashboard = new Vue({
el: '#vue-dashboard',
components:{ ... }
data: {
template: dashboardTemplate,
_compile: null,
option1: { ... }
},
render: function (h, b, v) {
this._compile = Vue.compile(this.template).render;
return this._compile();
}
});
render: function (h, b, v) {
var compile = Vue.compile(this.template);
return h(compile);
}