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 default function (label = '加签'){ | |
let container = document.createElement('div') | |
document.body.appendChild(container) | |
let isDestroy = false; | |
var instance = null; | |
return new Promise(function(resolve, reject){ | |
function removeDom(){ | |
if(!isDestroy && instance){ | |
instance.setState({ | |
visible:false, |
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 var memoizePromise = function(fun){ | |
var cache = {}; | |
return function(...args){ | |
var key = args.toString(); | |
return new Promise(function(resolve, reject){ | |
if(cache[key]){ | |
return resolve(cache[key]) | |
}else{ | |
fun.apply(this, args).then((data)=>{ | |
cache[key] = data; |
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 digitUppercase = function(n) { | |
var fraction = ['角', '分']; | |
var digit = [ | |
'零', '壹', '贰', '叁', '肆', | |
'伍', '陆', '柒', '捌', '玖' | |
]; | |
var unit = [ | |
['元', '万', '亿'], | |
['', '拾', '佰', '仟'] | |
]; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
class test{ | |
public function __contruct(){ | |
} | |
} |