[Solved] How to get data from App.vue in template

  • How to get variable ‘serverHost’ from App instance in template?

      <div id="q-app">
        <router-view />
    import Vue from 'vue'
    import store from './store'
    import { LocalStorage } from 'quasar'
    Vue.filter('formatPrice', function (value, fixed = 0) {
      let val = (value / 1).toFixed(fixed).replace('.', ',')
      return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.')
    let serverHost = LocalStorage.get.item('serverhost')
    export default {
      name: 'App',
      store: store,
      serverHost: serverHost


  • Upps! I just got the solution,

Log in to reply