From 078d542cfd4719a037dae8e467d4a3af3265723c Mon Sep 17 00:00:00 2001 From: Kinrany Date: Tue, 17 Mar 2020 01:47:20 +0300 Subject: [PATCH] Fix "Vue is not defined" I think I remember fixing this bug before... --- src/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 2cc16f8..0a5f108 100644 --- a/src/main.js +++ b/src/main.js @@ -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); -} \ No newline at end of file +}