This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// login component etc above | |
Vue.component("home-component", { | |
template : "<div> \ | |
<h1> Hello World! </h1> \ | |
</div>" | |
}) | |
// Vue initialization and mounting below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<home-component></home-component> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your corresponding keys | |
Parse.initialize("YOUR_APP_ID", "YOUR_JAVASCRIPT_KEY"); | |
// For back4app applications, this url is | |
// 'https://parseapi.back4app.com' | |
Parse.serverURL = 'YOUR_SERVER_URL' | |
// Assign LoginComponent | |
const LoginComponent = Vue.component('login-component', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>My Application</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" | |
crossorigin="anonymous"> | |
<link rel="stylesheet" href="css/signin.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LoginComponent = Vue.component('login-component', { | |
template: '<div class="signin-wrapper text-center"> \ | |
<form class="form-signin"> \ | |
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1> \ | |
<label for="inputEmail" class="sr-only">Email address</label> \ | |
<input v-model="email" type="email" id="inputEmail" class="form-control" placeholder="Email address" required="" autofocus=""> \ | |
<label for="inputPassword" class="sr-only">Password</label> \ | |
<input v-model="password" type="password" id="inputPassword" class="form-control" placeholder="Password" required=""> \ | |
<button v-on:click="login" class="btn btn-lg btn-primary btn-block" type="button">Sign in</button> \ | |
<p class="mt-5 mb-3 text-muted">© 2017-2018</p> \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HomeComponent = Vue.component("home-component", { | |
template : "<div> \ | |
<h1> Hello World! </h1> \ | |
</div>", | |
mounted : function () { | |
if (!Parse.User.current()) { | |
this.$router.replace("/login"); | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Your corresponding keys | |
Parse.initialize("YOUR_APP_ID", "YOUR_JAVASCRIPT_KEY"); | |
// For back4app applications, this url is | |
// 'https://parseapi.back4app.com' | |
Parse.serverURL = 'YOUR_SERVER_URL' | |
const LoginComponent = Vue.component('login-component', { | |
template: '<div class="signin-wrapper text-center"> \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<title>My Application</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" | |
crossorigin="anonymous"> | |
<link rel="stylesheet" href="css/signin.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HomeComponent = Vue.component("home-component", { | |
template: "<div> \ | |
<button class='btn btn-secondary m-2' v-on:click='logout'> Logout </button> \ | |
<div class='container'>\ | |
<input style='max-width: 500px;' class='form-control mx-auto' type='text' v-model='newTodo' v-on:keyup.enter='addTodo'> \ | |
<div style='max-width: 500px;' class='card mx-auto' v-for='todo in todos'> \ | |
<div class='card-body'> \ | |
<button v-on:click='deleteTodo(todo)' type='button' class='close'> \ | |
<span>×</span> \ | |
</button> \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// addTodo method of the HomeComponent. | |
// Rest of the code found on the repo: https://github.com/considine/parse-vue-starter/blob/master/js/app.js | |
addTodo() { | |
if (!this.newTodo || this.newTodo.length === 0) return; | |
var todo_acl = new Parse.ACL(); | |
todo_acl.setWriteAccess( Parse.User.current(), true); | |
todo_acl.setPublicReadAccess( true); | |
var todoParseObject = new Parse.Object("Todo", { |