Instantly share code, notes, and snippets.

@considine /app.js
Last active Aug 24, 2018

Embed
What would you like to do?
redirect to login if no user
const HomeComponent = Vue.component("home-component", {
  template : "<div> \
  <h1> Hello World! </h1> \
  </div>",
  mounted : function () {
    if (!Parse.User.current()) {
      this.$router.replace("/login");
    }
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment