Skip to content

Instantly share code, notes, and snippets.

View Serhansolo's full-sized avatar

Serhan Serhansolo

View GitHub Profile
import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/components/Login";
import Register from "@/components/Register";
Vue.use(VueRouter);
const routes = [
{
path: "/login",
<template>
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand" style="align-items: center;">
<img
src="https://vuejs.org/images/logo.png"
style="height: 50px; margin: 20px;"
/>
<span class="has-text-weight-medium is-size-4">
Vue.js + Veux + Firebase = ❤️!
</span>
switch (err) {
case LESS_THAN_ZERO:
case TOO_MANY:
case NOT_A_NUMBER:
console.log("Oops an error occured.");
break;
default:
console.log(fruitStand.numFruits);
break;
}
<template>
<div id="app">
<navbar />
<section class="section">
<div class="container is-desktop">
<router-view />
</div>
</section>
</div>
</template>
<div class="columns">
<div class="column is-half is-offset-one-quarter">
<div class="card">
<div class="card-content">
<form>
<div class="field">
<label class="label">E-mail</label>
<div class="control">
<input
v-model="email"
<template>
<div class="columns">
<div class="column is-half is-offset-one-quarter">
<div class="card">
<div class="card-content">
<div
v-if="validationErrors.length"
class="notification is-danger is-light"
>
<button @click="resetError()" class="delete"></button>
<template>
<div class="columns">
<div class="column is-half is-offset-one-quarter">
<div class="card">
<div class="card-content">
<div
v-if="validationErrors.length"
class="notification is-danger is-light"
>
<button @click="resetError()" class="delete"></button>
import firebase from "firebase/app";
// Import needed firebase modules
import "firebase/auth";
// Firebase app config
const config = {
apiKey: process.env.VUE_APP_API_KEY,
authDomain: process.env.VUE_APP_AUTH_DOMAIN,
databaseURL: process.env.VUE_APP_DATABASE_URL,
signUp() {
firebase
.auth()
.createUserWithEmailAndPassword(this.email, this.password)
.then(response => {
console.log("Success! ", response);
})
.catch(error => {
console.log("Failed!", error);
});
<template>
<div class="columns">
<div class="column is-half is-offset-one-quarter">
<div class="card">
<div class="card-content">
<div
v-if="validationErrors.length"
class="notification is-danger is-light"
>
<button @click="resetError()" class="delete"></button>