always-helper
Version:
前端项目开发中,经常会用到一些工具函数的合集。
2 lines (1 loc) • 353 B
JavaScript
export default function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"append",d=document.createElement("link");d.rel="stylesheet",d.type="text/css",n&&(d.onerror=function(){return n(!1)},d.onload=function(){return n(!0)}),d.href=e,"append"===t?document.head.appendChild(d):document.head.insertBefore(d,document.head.childNodes[0])}