How to use nativescript-vue - 10 common examples

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
onAuthStateChanged: data => { // optional
    console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
    if (data.loggedIn) {
      backendService.token = data.user.uid
      console.log(data.user.uid)
      store.commit('setUser', data.user)
      Vue.navigateTo(Home)
    }
    else {
      backendService.token = ""
      Vue.navigateTo(Login)
    }
  }
}).then(
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
onAuthStateChanged: data => { // optional
    console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
    if (data.loggedIn) {
      backendService.token = data.user.uid
      console.log(data.user.uid)
      store.commit('setUser', data.user)
      Vue.navigateTo(Home)
    }
    else {
      backendService.token = ""
      Vue.navigateTo(Login)
    }
  }
}).then(
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
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
    console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
    if (data.loggedIn) {
      backendService.token = data.user.uid
      console.log(data.user.uid)
      store.commit('setUser', data.user)
      Vue.navigateTo(Home)
    }
    else {
      backendService.token = ""
      Vue.navigateTo(Login)
github aaronksaunders / ns-vue-tabs-auth / src / main.js View on Github external
import Vue from "nativescript-vue";

import router from "./router";

import store from "./store";

import "./styles.scss";

// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;

console.log(store.state);
store.dispatch("auth/init").then(user => {
  if (user) {
    router.replace("home");
  } else {
    router.replace("login");
  }
});

new Vue({
  router,
  store,
  template: `
  
github triniwiz / nativescript-pusher / demo-vue / app / main.ts View on Github external
TNSPusherBeams.addDeviceInterest('debug-hello');
  TNSPusherBeams.addDeviceInterest('hello');
  console.log(TNSPusherBeams.getDeviceInterests());
  TNSPusherBeams.clearDeviceInterests();
  setTimeout(() => {
    TNSPusherBeams.addDeviceInterest('debug-hello');
    TNSPusherBeams.addDeviceInterest('hello');
    TNSPusherBeams.addDeviceInterest('osei');
  }, 5000);
  // TNSPusherBeams.addOnMessageReceivedCallback(message => {
  //   console.log('message', message);
  // });
});

// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = TNS_ENV === 'production';

new Vue({
  render: h => h('frame', [h(App)])
}).$start();
github nativescript-vue / nativescript-vue / samples / app / 536.js View on Github external
<button>
  
  `,
  methods: {
    openWizard() {
      // show the wizard in a modal, and make sure it is fullscreen.
      this.$showModal(WizardModal, {
        fullscreen: true
      }).then(res =&gt; {
        console.log('wizard completed with res', res)
      })
    }
  }
}

new Vue({
  components: {
    TabContent
  },
  template: `
  
    
      
        
          
            
            
          
        
      
    
  </button>
github triniwiz / nativescript-pusher / demo-vue / app / main.ts View on Github external
console.log(TNSPusherBeams.getDeviceInterests());
  TNSPusherBeams.clearDeviceInterests();
  setTimeout(() => {
    TNSPusherBeams.addDeviceInterest('debug-hello');
    TNSPusherBeams.addDeviceInterest('hello');
    TNSPusherBeams.addDeviceInterest('osei');
  }, 5000);
  // TNSPusherBeams.addOnMessageReceivedCallback(message => {
  //   console.log('message', message);
  // });
});

// Prints Vue logs when --env.production is *NOT* set while building
Vue.config.silent = TNS_ENV === 'production';

new Vue({
  render: h => h('frame', [h(App)])
}).$start();
github aaronksaunders / ns-vue-tabs-auth / src / main.js View on Github external
import "./styles.scss";

// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;

console.log(store.state);
store.dispatch("auth/init").then(user =&gt; {
  if (user) {
    router.replace("home");
  } else {
    router.replace("login");
  }
});

new Vue({
  router,
  store,
  template: `
  
  
    
  `
}).$start();
github jlooper / elocute / mobile-v2 / src / main.js View on Github external
}
}).then(
  instance => {
    console.log("firebase.init done");
  },
  error => {
    console.log(`firebase.init error: ${error}`);
  }
);

import './styles.scss';

// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;

new Vue({

  routes,

  store,

  render: h => h(backendService.isLoggedIn() ? Vue.navigateTo(Home) : Vue.navigateTo(Login)),

  mounted() {
    
    // force first redirect
    /*if (backendService.isLoggedIn()) {
      router.push('/home')
    }
    else {
      router.push('/login')
    }*/
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