switch to doneEach and cache #main dom

This commit is contained in:
Leopoldthecoder 2017-03-07 11:30:09 +08:00
commit 9c54bafae4
8 changed files with 27 additions and 33 deletions

View file

@ -10,7 +10,7 @@ const cacheNode = {}
*/
export function getNode (el, noCache = false) {
if (typeof el === 'string') {
el = noCache ? find(el) : (cacheNode[el] || find(el))
el = noCache ? find(el) : (cacheNode[el] || (cacheNode[el] = find(el)))
}
return el