No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. BenceSzalai
    • Profile
    • Following 0
    • Followers 1
    • Topics 0
    • Posts 3
    • Best 2
    • Groups 0

    BenceSzalai

    @BenceSzalai

    IT Consultant, developer

    2
    Reputation
    1
    Profile views
    3
    Posts
    1
    Followers
    0
    Following
    Joined Last Online
    Website sbnc.eu

    BenceSzalai Follow

    Best posts made by BenceSzalai

    • RE: How to access axios inside store action?

      You can simply assign your axios instance in a boot file.
      Inside src/boot/axios.js you can use this:

      import axios from 'axios'
      
      export default ({ store, Vue }) => {
        Vue.prototype.$axios = axios
        store.$axios = axios
      }
      

      Once it’s set up like this, axios can be accessed in your store actions as this.$axios.

      posted in Help
      BenceSzalai
      BenceSzalai
    • RE: How to access translations in static .js file?

      For Quasar v2 the default src/boot/i18n.js is:

      import { createI18n } from 'vue-i18n'
      import messages from 'src/i18n'
      
      export default ({ app }) => {
        const i18n = createI18n({
          locale: 'en-US',
          messages
        })
        app.use(i18n)
      }
      

      Modified version:

      import { createI18n } from 'vue-i18n'
      import messages from 'src/i18n'
      
      let i18n
      export default ({ app }) => {
        i18n = createI18n({
          locale: 'en-US',
          messages
        })
        app.use(i18n)
      }
      
      export { i18n }
      

      But really you should rather use this.$t(...) whenever you can.

      posted in Help
      BenceSzalai
      BenceSzalai

    Latest posts made by BenceSzalai

    • RE: How to access translations in static .js file?

      For Quasar v2 the default src/boot/i18n.js is:

      import { createI18n } from 'vue-i18n'
      import messages from 'src/i18n'
      
      export default ({ app }) => {
        const i18n = createI18n({
          locale: 'en-US',
          messages
        })
        app.use(i18n)
      }
      

      Modified version:

      import { createI18n } from 'vue-i18n'
      import messages from 'src/i18n'
      
      let i18n
      export default ({ app }) => {
        i18n = createI18n({
          locale: 'en-US',
          messages
        })
        app.use(i18n)
      }
      
      export { i18n }
      

      But really you should rather use this.$t(...) whenever you can.

      posted in Help
      BenceSzalai
      BenceSzalai
    • RE: How to access axios inside store action?

      You can simply assign your axios instance in a boot file.
      Inside src/boot/axios.js you can use this:

      import axios from 'axios'
      
      export default ({ store, Vue }) => {
        Vue.prototype.$axios = axios
        store.$axios = axios
      }
      

      Once it’s set up like this, axios can be accessed in your store actions as this.$axios.

      posted in Help
      BenceSzalai
      BenceSzalai
    • RE: How to access axios inside store action?

      @metalsadman said in How to access axios inside store action?:

      @realtebo take the example from the docs https://quasar.dev/quasar-cli/cli-documentation/boot-files#Accessing-data-from-boot-files.

      Also for anyone interested, the now broken link above has been moved here: https://quasar.dev/quasar-cli/boot-files#Accessing-data-from-boot-files

      posted in Help
      BenceSzalai
      BenceSzalai