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
{# Macro #} | |
{% macro getState(abbr) %} | |
{% set states = { | |
'AL' : 'Alabama', | |
'AK' : 'Alaska', | |
'AZ' : 'Arizona', | |
'AR' : 'Arkansas', | |
'CA' : 'California', | |
'CO' : 'Colorado', | |
'CT' : 'Connecticut', |
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 { setContext } = require('apollo-link-context'); | |
const { HttpLink } = require('apollo-link-http'); | |
const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools'); | |
const fetch = require('node-fetch'); | |
module.exports = function(api) { | |
api.createSchema(async function(graphql) { | |
const http = new HttpLink({ | |
uri: 'http://example.com/api', | |
fetch |
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
<template> | |
<form method="post" accept-charset="UTF-8"> | |
<label for="loginName">Username or email</label> | |
<input v-model="loginName" id="loginName" type="text" name="loginName" /> | |
<label for="password">Password</label> | |
<input v-model="password" id="password" type="password" name="password" /> | |
<label> | |
<input v-model="rememberMe" type="checkbox" name="rememberMe" /> |
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
<template> | |
<form method="post" accept-charset="UTF-8"> | |
<h3><label for="username">Username</label></h3> | |
<input v-model="username" id="username" type="text" name="username" /> | |
<h3><label for="email">Email</label></h3> | |
<input v-model="email" id="email" type="text" name="email" /> | |
<h3><label for="password">Password</label></h3> | |
<input v-model="password" id="password" type="password" name="password" /> |
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 { setContext } = require('apollo-link-context') | |
const { HttpLink } = require('apollo-link-http') | |
const { | |
introspectSchema, | |
makeRemoteExecutableSchema, | |
} = require('graphql-tools') | |
const fetch = require('node-fetch') | |
const http = new HttpLink({ | |
uri: 'http://example.com/api', |
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
<template> | |
<div v-if="visible" class="modal"> | |
<div> | |
<div>{{ message }}</div> | |
<div> | |
<button class="button-secondary" @click="cancel">Cancel</button> | |
<button class="button-primary" @click="confirm">Confirm</button> | |
</div> | |
</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
// Server API makes it possible to hook into various parts of Gridsome | |
// on server-side and add custom data to the GraphQL data layer. | |
// Learn more: https://gridsome.org/docs/server-api | |
// Changes here requires a server restart. | |
// To restart press CTRL + C in terminal and run `gridsome develop` | |
const { setContext } = require('apollo-link-context') | |
const { HttpLink } = require('apollo-link-http') | |
const { |
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
<template> | |
<!-- Example Usage --> | |
<div class="menu"> | |
<ScreenDimmer :visible="menuOpen" /> | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { |
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
/* Before */ | |
function getErrorMessage(error) { | |
if(error === 'username') { | |
return `Username is required` | |
} else if (error === 'email') { | |
return `Don't forget your email!` | |
} else if (error === 'password') { | |
return `Please enter your password` | |
} | |
} |
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 $ = selector => document.querySelector(selector) | |
const $$ = selector => document.querySelectorAll(selector) | |
// $ returns a node (or null) | |
$('.nav').classList.add('open') | |
// $$ returns a NodeList (which is empty if no matching elements are found) | |
$$('ul > li > a').forEach($node => $node.style.background = 'red') |
OlderNewer