0
votes

The question is. I am using Vue into simple html page. In one place I inject Vue via <div id="app"></div>. So can I some how pass value via data attribute or any other way into new Vue element that will be created here? By the way after Vue work my div to which I am connecting will be replaced by root Vue element. Can anyone help me, please?

1
Do you mean that you want to initialize Vue instance property el not with element id?Lev Khruschev

1 Answers

0
votes

I hope I understood a thing. If you don't need your data being reactive you may use $options:

let someData = {...}

new Vue({
  el: rootComponentElement,
  someKeyValue: someData,
  render: h => h(rootComponent)
})

and then call it via $root.$options.someKeyValue