[Vuejs]-How to get the Vue module in helper function / mixin

0👍

In your helper.js file you do not have access to the vue instance using this binding. You have to explicitly import Vue.

// helper.js
import Vue from "vue";

const func = {
  getSomthingFromCookie(check){
    return Vue.$myCookie.get('check') === check ? "something" : "else"
  }
}

export default func

Leave a comment