Javascript 在Nuxt.js中以编程方式创建组件

Javascript 在Nuxt.js中以编程方式创建组件,javascript,vue.js,components,vue-component,nuxt.js,Javascript,Vue.js,Components,Vue Component,Nuxt.js,我试图以编程方式创建一个nuxt.js组件。我尝试了下面在Vue中有效的方法。但是它在nuxt.js中似乎不起作用,因为它在Vue对象上实例化了组件。因此,它无法访问其父级数据 var ComponentClass = Vue.extend(component_to_use); var instance = new ComponentClass(); instance.$mount(); // pass nothing this.$refs.container.appendChi

我试图以编程方式创建一个nuxt.js组件。我尝试了下面在Vue中有效的方法。但是它在nuxt.js中似乎不起作用,因为它在Vue对象上实例化了组件。因此,它无法访问其父级数据

  var ComponentClass = Vue.extend(component_to_use);
  var instance = new ComponentClass();
  instance.$mount(); // pass nothing
  this.$refs.container.appendChild(instance.$el);
我在Nuxt.js中找不到正确的方法。有人知道怎么做吗? 注意:我知道我可以将数据作为道具传递,但这是低效的