My Vue.js application (version 2.0.0rc7) is structured using single page components, with the main component being named App
. In order to render my app within a div identified by app
, I have created a script named main.js
:
import Vue from 'vue'
import App from './App.vue'
var vm = new Vue({
el: '#app',
render: h => h(App)
})
The current setup is functioning effectively with webpack handling imports. However, I am interested in making my application easily integratable for other developers to use as a drop-in solution on their websites. So, I am exploring ways to pass properties to the main App
component.
For instance, I envision allowing developers to load my pre-built app through HTML script tags and then initialize it like so:
App(dataObj1, dataObj2, ..., '#id-of-div-element-to-mount')