This file contains hidden or 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
var awesome | |
var myFunc = function() { | |
var awesome | |
} |
This file contains hidden or 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
var myFunc = function() {} |
This file contains hidden or 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
function myFunc() {} |
This file contains hidden or 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
function myFunc() {} |
This file contains hidden or 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
import isNumber from 'lodash.isnumber' | |
export function toDevicePixelRatio(size, options = {}) { | |
const { | |
ratio = 2, | |
scale = 1, | |
even = true | |
} = options | |
const evenFactor = even ? 2 : 1 | |
const floatSize = parseFloat(size) |
This file contains hidden or 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
{ | |
"main": "dist", | |
"scripts": { | |
"build": "node_modules/.bin/webpack --config webpack.config.js", | |
"dev": "node_modules/.bin/webpack --config webpack.config.js --watch" | |
}, | |
"peerDependencies": { | |
"vue": "^2.5.2" | |
}, | |
"devDependencies": { |
This file contains hidden or 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
export function InstallComponentsPlugin(components) { | |
const nameless = [].concat(components).find(component => !!component.name) | |
if (nameless) { | |
return void console.error(`[Install Components Plugin warn]: Component is missing Name in ${nameless.__file}.`) | |
} | |
return { | |
install(Vue) { | |
[].concat(components).forEach(component => Vue.component(component.name, component)) | |
} | |
} |
This file contains hidden or 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> | |
<a v-bind="{ href, target, ariaLabel }" class="github-corner"> | |
<svg | |
aria-hidden="true" | |
viewBox="0 0 250 250" | |
v-bind="{ width, height }" | |
:style="`fill: ${fillColor}; color:${octoColor}; position: absolute; top: 0; border: 0; right: 0;`"> | |
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path> | |
<path | |
class="octo-arm" |
This file contains hidden or 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
<script> | |
// https://vuejs.org/v2/guide/render-function.html#Functional-Components | |
// Implementation | |
export default { | |
functional: true, | |
render(h, { slots }) { | |
return slots().default | |
} | |
} |
This file contains hidden or 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
// Listen for orientation changes | |
window.addEventListener("orientationchange", function() { | |
// Announce the new orientation number | |
alert(window.orientation); | |
}, false); | |
// Listen for resize changes | |
window.addEventListener("resize", function() { | |
// Get screen size (inner/outerWidth, inner/outerHeight) | |