V
V
Vyacheslav Sobolev2018-06-22 16:44:45
Vue.js
Vyacheslav Sobolev, 2018-06-22 16:44:45

How to pass parameters when rendering a vue component?

I want to pass parameters to the component via render, but it doesn't work like this:

import Vue from 'vue'
import App from './App.vue'

window.app = function(opt){
  new Vue({
    el: opt.el,
    render: h => h(App, {
      props: {
        items: opt.items
      }
    })
  });
};

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question