Godofbrowser / vuejs-dialog

A lightweight, promise based alert, prompt and confirm dialog
351 stars 111 forks source link

this.$dialog is undefined #7

Closed dtgeorge closed 6 years ago

dtgeorge commented 7 years ago

Hello!

I am newbee to vue.js. Gonna try to use plugin. I proceeded all steps for HTML installation: <script type="text/javascript" src="./path/to/vue.min.js"></script> <script type="text/javascript" src="./path/to/vuejs-dialog.min.js"></script> window.Vue.use(VuejsDialog)

and nothing happend... Inside my app var app = new Vue(.... ... this.$dialog == undefined also window.app.$dialog == undefined too. What am I do wrong?

Godofbrowser commented 7 years ago

@dtgeorge sorry about that, i will update the docs. Please use window.Vue.use(VuejsDialog.default)

dtgeorge commented 7 years ago

Ok! Thanks!

Also, what you think about unminified/unuglified version of plugin? It's normal for opensource projects....

Godofbrowser commented 7 years ago

Yeah, the source code is not minified/uglified. The reason for the minification of the production file is actually to reduce its size and not make the page/script unreasonably large. Again, the plugin includes Javascripts, stylesheets and vue files. If the plugin was not bundled it'll mean having the users include multiple scripts and vue templates into the page. Even if we try to make them into a single file, the plugin might become difficult to maintain. That's the reason why unlike Jquery plug-ins and likes, we have to bundle this using a bundler like webpack (and minification is technically inevitable).

Godofbrowser commented 6 years ago

Closing due to inactivity.