creativetimofficial / vue-argon-dashboard

Vue Argon Dashboard
https://demos.creative-tim.com/vue-argon-dashboard
MIT License
379 stars 724 forks source link

Import VueSession not working #62

Closed santimakci closed 3 years ago

santimakci commented 3 years ago

Hi, I'm trying to use VueSession in template but not detect the import. I installed vue session with npm install VueSession and mi main.js is next:

import { createApp } from "vue"; import App from "./App.vue"; import router from "./router"; import ArgonDashboard from "./plugins/argon-dashboard"; import "element-plus/lib/theme-chalk/index.css"; import VueSession from "vue-session";

var options = { persist: true }

const appInstance = createApp(App);

appInstance.use(router); appInstance.use(ArgonDashboard); appInstance.use(VueSession, options) appInstance.mount("#app");

When I load home page recive this error:

Cannot set property '$session' of undefined at Object.VueSession.install (index.js?0628:13) at Object.use (runtime-core.esm-bundler.js?5c40:29

$Session is used in Navbar:

  <li
    style="display: inline-block; margin: 0; padding: 0"
    v-if="this.$session.exists()"
  >
    {{ this.$session.get("user").username }}
  </li>

some idea?

github-actions[bot] commented 3 years ago

@santimakci this issue was automatically closed because it did not follow the bellow rules:


IMPORTANT: Please use the following link to create a new issue:

https://www.creative-tim.com/new-issue/vue-argon-dashboard

**If your issue was not created using the app above, it will be closed immediately.**

Love Creative Tim? Do you need Angular, React, Vuejs or HTML? You can visit:
👉  https://www.creative-tim.com/bundles
👉  https://www.creative-tim.com