I developed some vue component (grid,popup,layout..) by webstorm with (vue-cli..webpack ...) .
My development environment: webstorm + webpack + vue-cli
Now i want to know how i can use that in a javascript?
i can call it like this
In main js , i write ..
import Grid from './Grid'
window.$grid = Grid
and i use webpack package app.js (mycode and others..)
My demo.html
1.<script src=app.js> <script src=demo.js>
2.<div id="showdiv"></div>
3.
demo.js
$('showdiv').append('<grid :options="options"></grid>')
var grid = window.$grid
var gridvue = new Vue({
el: '#showdiv',
data: {
options: options
},
components: {grid}
})
But if i use more component.vue i must create the same numbers of new Vue I dont think it's a good way to use vue outside.
I'm very grateful to who answer my question , thanks! sorry for my english...