/** * svg图标 * @author yutent * @date 2019/07/08 11:17:58 */ 'use strict' function appendSVGDOM() { var container, svg, str = '' container = document.createElement('div') container.innerHTML = str svg = container.querySelector('svg') svg.setAttribute('aria-hidden', 'true') svg.style.cssText = 'overflow:hidden;position: absolute;width:0;height:0' document.head.appendChild(svg) } export default !(function(params) { if (~['complete', 'loaded', 'interactive'].indexOf(document.readyState)) { setTimeout(appendSVGDOM, 0) } else { var loadedEvent = function() { document.removeEventListener('DOMContentLoaded', loadedEvent, false) appendSVGDOM() } document.addEventListener('DOMContentLoaded', loadedEvent, false) } })()