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
if (callback && typeof(callback) === "function") { | |
callback(); | |
} |
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
import EventBus from 'Events.js' | |
export default { | |
... | |
mounted() { | |
EventBus.$emit('eventName', payload); | |
} | |
... | |
} |
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
# Created by https://www.gitignore.io/api/vue,node,nuxt,macos,visualstudiocode | |
# Edit at https://www.gitignore.io/?templates=vue,node,nuxt,macos,visualstudiocode | |
### macOS ### | |
# General | |
.DS_Store | |
.AppleDouble | |
.LSOverride | |
# Icon must end with two \r |
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
/* https://stackoverflow.com/questions/28217486/font-renders-thicker-in-browsers */ | |
body { | |
-moz-osx-font-smoothing: grayscale; | |
-webkit-font-smoothing: antialiased; | |
} |
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
/* visibility */ | |
.hidden { | |
display: none!important; | |
} | |
@media (max-width: 599px) { | |
.hidden-p { display: none!important; } | |
} | |
@media (min-width: 600px) and (max-width: 899px) { | |
.hidden-tp { display: none!important; } | |
} |
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
// https://davidwalsh.name/javascript-attributes | |
Array.prototype.slice.call(document.getElementById("myId").attributes).forEach(function(item) { | |
console.log(item.name + ': '+ item.value); | |
}); |
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 lang="en" prefix="og: http://ogp.me/ns/website#"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Title</title> | |
<meta name="description" content="Description"> | |
<!-- og --> |
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
// https://davidwalsh.name/function-debounce | |
debounce = function(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |
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
var events = (function(){ | |
var topics = {}; | |
var hOP = topics.hasOwnProperty; | |
return { | |
subscribe: function(topic, listener) { | |
// Create the topic's object if not yet created | |
if(!hOP.call(topics, topic)) topics[topic] = []; | |
// Add the listener to queue |
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
function encodeQueryData(data) { | |
var ret = []; | |
for (let d in data) | |
ret.push(encodeURIComponent(d) + '=' + encodeURIComponent(data[d])); | |
return ret.join('&'); | |
} |
NewerOlder