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 (ELEMENT) { | |
ELEMENT.matches = ELEMENT.matches || ELEMENT.mozMatchesSelector || ELEMENT.msMatchesSelector || ELEMENT.oMatchesSelector || ELEMENT.webkitMatchesSelector | |
ELEMENT.closest = ELEMENT.closest || function closest (selector) { | |
if (!this) return null | |
if (this.matches(selector)) return this | |
return !this.parentElement ? null : this.parentElement.closest(selector) | |
} | |
ELEMENT.contains = ELEMENT.contains || function contains (elem) { | |
var comparison = this.compareDocumentPosition(elem) | |
return comparison === 0 || comparison & 16 |
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"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Skeleton Screen</title> | |
<style> | |
:root { | |
--card-padding: 1rem; | |
--card-width: 80rem; |
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 createWorker (fun) { | |
var blob = new Blob(['(' + fun.toString() + ')()']) | |
var url = window.URL.createObjectURL(blob) | |
return new Worker(url) | |
} | |
var clockWorker = createWorker(function () { | |
var adjustTimer = 1000 - Date.now() % 1000 | |
setTimeout(function () { | |
self.postMessage(Date.now()) |
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 vmMapToDom(vm) { | |
if(vm.$el.setAttribute) { | |
var name = '$' + (vm.$options.name + vm._uid + '').replace(/-/g, '_'); | |
vm.$el.setAttribute('vm' + vm._uid, name) | |
window[name] = vm | |
} | |
var l = vm.$children.length; | |
var i = 0; | |
while (i < l) { | |
vmMapToDom(vm.$children[i]); |
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 getTrue () { return true } | |
function getSelf (item) { return item } | |
export default { | |
data () { | |
return { | |
queryCount: 0, | |
queryLinq: {} | |
} | |
}, |
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
class VueWait { | |
constructor (Vue) { | |
this.initialized = false | |
this.init(Vue) | |
} | |
init (Vue) { | |
if (!this.initialized) { | |
this.stateHandler = new Vue({ | |
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
function broadcast(componentName, eventName, params) { | |
this.$children.forEach(child => { | |
var name = child.$options.componentName; | |
if (name === componentName) { | |
child.$emit.apply(child, [eventName].concat(params)); | |
} else { | |
broadcast.apply(child, [componentName, eventName].concat([params])); | |
} | |
}); |
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 RoutesConfigArr from './routes' | |
import commonRoutesArr from './common' | |
import { recordChannel } from './hooks' | |
function nextFactory (context, middlewareArr, index) { | |
const subsequentMiddleware = middlewareArr[index] | |
if (!subsequentMiddleware) { | |
return context.next |
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
Vue.prototype.$get2 = function (obj, key, def, sp = '.') { | |
var p = 0 | |
var keys = (typeof key === 'string') ? key.split(sp) : key | |
var len = keys.length | |
while (obj && p < len) { | |
obj = obj[keys[p++]] | |
} | |
return (obj === undefined || p < len) ? def : obj | |
} |
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
``` App.vue | |
<template> | |
<component :is="layout" :layout.sync="layout"> | |
<router-view /> | |
</component> | |
</template> | |
<script> | |
export default { | |
name: `App`, |
OlderNewer