How to use the nativescript-vue.prototype function in nativescript-vue

To help you get started, we’ve selected a few nativescript-vue 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 jlooper / elocute / mobile-v2 / src / main.js View on Github external
import AuthService from './services/AuthService'
import { TNSFontIcon, fonticon } from 'nativescript-fonticon'

import Home from './components/Home'
import Login from './components/Login'

//import { setStatusBarColors } from './utils/statusBar'
const backendService = new BackendService()
const authService = new AuthService()
const store = new Vuex.Store(storeConf)

Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
  Vue.navigateTo(routes[to])
  }

//TNSFontIcon.debug = true; 
TNSFontIcon.paths = {
  'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();

Vue.filter('fonticon', fonticon)

Vue.use(Vuex)


firebase.init({
  onAuthStateChanged: data => { // optional
github tralves / groceries-ns-vue / app / store / index.js View on Github external
const store = new Vuex.Store({
  state: {
    // array of grocery items
    items: [],
    // array of ongoing tasks. We keep track of the tasks to show/hide the
    // activity indicator in the groceries page.
    processingTasks: []
  },
  mutations,
  actions,
  getters,
  strict: debug,
});

Vue.prototype.$store = store;

export default store;
github Cambalab / ns-vue-radio / app / store / index.js View on Github external
import { State } from './state'
// import firebase from 'nativescript-plugin-firebase'

Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production'

const store = new Vuex.Store({
  state: new State(),
  mutations,
  getters,
  actions,
  strict: debug
})

Vue.prototype.$store = store

export default store
github tralves / groceries-ns-vue / app / main.js View on Github external
import Groceries from './components/Groceries/Groceries.vue'
import Login from './components/Login/Login.vue'
import { setStatusBarColors } from './utils/statusBar'
import './app.css'

import storeConf from './store/store.js'

global.process = { env: { } } // hack! a build process should replace process.env's with static strings.
const backendService = new BackendService()
setStatusBarColors()

const store = new Vuex.Store(storeConf);

// Adding the vuex store to the main vue object does not work. See:
// https://github.com/rigor789/nativescript-vue/issues/46#issuecomment-331925815
Vue.prototype.$store = store

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: Login,
      meta: { hiddenActionBar: true }
    },
    {
      path: '/groceries',
      component: Groceries,
      meta: { requiresAuth: true }
    },
    { path: '*', redirect: '/login' }
  ]
})
github championswimmer / nativescript-vue-typescript-starter / app / store / index.ts View on Github external
import Vue from 'nativescript-vue';
import Vuex from 'vuex';

import counter from './modules/counter';

Vue.use(Vuex);

const store = new Vuex.Store({
  modules: {
    counter,
  },
  strict: DEBUG_MODE,
});

Vue.prototype.$store = store;

export default store;
github nativescript-vue / vue-cli-template / template / src / store / index.js View on Github external
import Vuex from 'vuex';

import counter from './modules/counter';

Vue.use(Vuex);

const debug = process.env.NODE_ENV !== 'production';

const store = new Vuex.Store({
  modules: {
    counter,
  },
  strict: debug,
});

Vue.prototype.$store = store;

module.exports = store;
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
import storeConf from './store';
import Vuex from 'vuex';
import firebase from 'nativescript-plugin-firebase'
import BackendService from './services/BackendService'
import AuthService from './services/AuthService'
import { TNSFontIcon, fonticon } from 'nativescript-fonticon'

import Home from './components/Home'
import Login from './components/Login'

//import { setStatusBarColors } from './utils/statusBar'
const backendService = new BackendService()
const authService = new AuthService()
const store = new Vuex.Store(storeConf)

Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
  Vue.navigateTo(routes[to])
  }

//TNSFontIcon.debug = true; 
TNSFontIcon.paths = {
  'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();

Vue.filter('fonticon', fonticon)

Vue.use(Vuex)
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
import firebase from 'nativescript-plugin-firebase'
import BackendService from './services/BackendService'
import AuthService from './services/AuthService'
import { TNSFontIcon, fonticon } from 'nativescript-fonticon'

import Home from './components/Home'
import Login from './components/Login'

//import { setStatusBarColors } from './utils/statusBar'
const backendService = new BackendService()
const authService = new AuthService()
const store = new Vuex.Store(storeConf)

Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
  Vue.navigateTo(routes[to])
  }

//TNSFontIcon.debug = true; 
TNSFontIcon.paths = {
  'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();

Vue.filter('fonticon', fonticon)

Vue.use(Vuex)
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
import Vuex from 'vuex';
import firebase from 'nativescript-plugin-firebase'
import BackendService from './services/BackendService'
import AuthService from './services/AuthService'
import { TNSFontIcon, fonticon } from 'nativescript-fonticon'

import Home from './components/Home'
import Login from './components/Login'

//import { setStatusBarColors } from './utils/statusBar'
const backendService = new BackendService()
const authService = new AuthService()
const store = new Vuex.Store(storeConf)

Vue.prototype.$store = store;
Vue.prototype.$routes = routes;
Vue.prototype.$authService = authService
//route manually
Vue.prototype.$changeRoute = (to) => {
  Vue.navigateTo(routes[to])
  }

//TNSFontIcon.debug = true; 
TNSFontIcon.paths = {
  'fa': './font-awesome.css'
};
TNSFontIcon.loadCss();

Vue.filter('fonticon', fonticon)

Vue.use(Vuex)