Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing component via Vue.use causes error in old browsers #79

Open
gamtiq opened this issue Dec 29, 2018 · 0 comments
Open

Installing component via Vue.use causes error in old browsers #79

gamtiq opened this issue Dec 29, 2018 · 0 comments

Comments

@gamtiq
Copy link

gamtiq commented Dec 29, 2018

If I install component via Vue.use and don't add it to transpileDependencies option of Vue CLI, I get the following error on browsers that don't support Enhanced Object Literals:

Uncaught SyntaxError: Unexpected token (

The error arises because of the following code in src/plugin.js:

export default {
	install(Vue, options) {
		Vue.component('SweetModal', SweetModal)
		Vue.component('SweetModalTab', SweetModalTab)
	}
}

To fix the issue it is necessary change line #4 to:

install: function install(Vue, options) {

To work around the issue, install components by calling Vue.component:

import { SweetModal, SweetModalTab } from 'sweet-modal-vue';
...
Vue.component('SweetModal', SweetModal);
Vue.component('SweetModalTab', SweetModalTab);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant