How to use the js-cookie.get function in js-cookie

To help you get started, we’ve selected a few js-cookie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yjx-passion / vue-element-admin / src / store / modules / app.js View on Github external
import Cookies from 'js-cookie'

const app = {
  state: {
    // 中英文
    language: Cookies.get('language') || 'zh',
    sidebar: {
      opened: !+Cookies.get('sidebarStatus')
    }
  },
  mutations: {
    TOGGLE_SIDEBAR: state => {
      if (state.sidebar.opened) {
        Cookies.set('sidebarStatus', 1)
      } else {
        Cookies.set('sidebarStatus', 0)
      }
      state.sidebar.opened = !state.sidebar.opened
    },
    // 中英文
    SET_LANGUAGE: (state, language) => {
      state.language = language
github FlowzPlatform / website-builder / src / views / Banner / add_banner.vue View on Github external
async mounted () {
    let userId = Cookies.get('userDetailId')
    if (userId !== '' && userId !== undefined) {
      this.$Spin.show();
      await axios.get(baseURL + '/project-configuration?userId=' + userId).then(res => {
        for (let item of res.data.data) {
          this.webOptions.push({label: item.websiteName, value: item.id})
        }
      }).catch(err => {
      })
      await axios.get(bannertypeUrl + '?userId=' + userId + '&status=true&$paginate=false').then(res=> {
        console.log('res.data ::', res.data)
        for(let item of res.data) {
          let webname = ''
          let finx = _.findIndex(this.webOptions, {value: item.website_id})
          if (finx !== -1) {
            webname = ' (' + this.webOptions[finx].label + ') '
          }
github FlowzPlatform / website-builder / src / views / User / userList.vue View on Github external
mounted() {
        this.$Loading.start();
        let userId = Cookies.get("userDetailId");
        axios({
            method: "get",
            url: baseUrl + '/subscription-websites',
            headers: {
                Authorization: Cookies.get("auth_token"),
                subscriptionId: Cookies.get("subscriptionId")
            }
        }).then((response) => {
            console.log("------------------------response", response);
            if (response.data.data.length == 0) {
                this.$Notice.error({
                    desc: "Websites not available for this subscription",
                    title: "Error",
                    duration: 4.5
                });
            } else {
                this.webOptions = response.data.data;
            }
            this.$Loading.finish();
        });
    }
};
github FrankerFaceZ / FrankerFaceZ / src / experiments.js View on Github external
usingTwitchExperiment: key => this.usingTwitchExperiment(key),
			getTwitchAssignment: key => this.getTwitchAssignment(key),
			hasTwitchOverride: key => this.hasTwitchOverride(key),
			setTwitchOverride: (key, val) => this.setTwitchOverride(key, val),
			deleteTwitchOverride: key => this.deleteTwitchOverride(key),

			getAssignment: key => this.getAssignment(key),
			hasOverride: key => this.hasOverride(key),
			setOverride: (key, val) => this.setOverride(key, val),
			deleteOverride: key => this.deleteOverride(key),

			on: (...args) => this.on(...args),
			off: (...args) => this.off(...args)
		});

		this.unique_id = Cookie.get('unique_id');

		this.Cookie = Cookie;

		this.experiments = {};
		this.cache = new Map;
	}
github gitlabhq / gitlabhq / ee / app / assets / javascripts / ee_trial_banner / ee_trial_banner.js View on Github external
handleTrialBannerDismiss() {
    this.toggleMainNavbarMargin(false);
    this.toggleSecondaryNavbarMargin(false);
    if (Cookies.get(this.COOKIE_KEY)) {
      Cookies.set(this.COOKIE_KEY, 'false');
    }
  }
}
github SaraVieira / awesome-talks / src / Utils / state.js View on Github external
export const getStorage = (key, defaultValue) => {
    if (typeof window !== 'undefined') {
        return Cookies.get(key) ? JSON.parse(Cookies.get(key)) : defaultValue
    }

    return defaultValue
}
github wmz1930 / Jeebase / jeebase-wechat / jeebase-wechat-vant / src / store / modules / app.js View on Github external
import Cookies from 'js-cookie'

const app = {
  state: {
    sidebar: {
      opened: !+Cookies.get('sidebarStatus'),
      withoutAnimation: false
    },
    device: 'desktop',
    language: Cookies.get('language') || 'en',
    size: Cookies.get('size') || 'medium'
  },
  mutations: {
    TOGGLE_SIDEBAR: state => {
      if (state.sidebar.opened) {
        Cookies.set('sidebarStatus', 1)
      } else {
        Cookies.set('sidebarStatus', 0)
      }
      state.sidebar.opened = !state.sidebar.opened
      state.sidebar.withoutAnimation = false
    },
    CLOSE_SIDEBAR: (state, withoutAnimation) => {
      Cookies.set('sidebarStatus', 1)
      state.sidebar.opened = false
      state.sidebar.withoutAnimation = withoutAnimation
github gitlabhq / gitlabhq / app / assets / javascripts / design_management / components / design_sidebar.vue View on Github external
data() {
    return {
      isResolvedCommentsPopoverHidden: parseBoolean(Cookies.get(this.$options.cookieKey)),
      discussionWithOpenForm: '',
    };
  },
  computed: {