Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How can I access global properties in vuex actions?


Hi,
I bought your Metronic 8 theme.

I am using VUE verison. How Can I access this globalProperties in store modules @actions.

you can see what property I want to access : https://i.imgur.com/FfvPRVE.jpg

Thank you.
Berat


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


i want to access app instance not router or store. this is not answer you didnt understand my question



If you want to get these global properties through an app instance, you can just follow an object structure:

console.log(app.config.globalProperties.$store);


You can read more about globalProperties in the official Vue doc:



Hi,

You can get store instances using useStore function imported from vuex.


import { useStore } from "vuex";
import { useRoute, useRouter } from "vue-router";


const store = useStore();
const route = useRoute();
const router = useRouter();


You can check examples in file src/layout/Layout.vue.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(