Skip to content

Commit

Permalink
Fix "Vue is not defined"
Browse files Browse the repository at this point in the history
I think I remember fixing this bug before...
  • Loading branch information
Kinrany committed Mar 16, 2020
1 parent 01e24c5 commit 078d542
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import VueP5 from "./p5.vue";

export default VueP5;

if (Vue) {
// `typeof Vue !== 'undefined'` prevents
// the "Vue is not defined" error
if (typeof Vue !== 'undefined' && Vue) {
Vue.component('vue-p5', VueP5);
}
}

0 comments on commit 078d542

Please sign in to comment.