https://github.com/excaliburhan/xp-loadcss
动态导入css,支持promise
https://github.com/excaliburhan/xp-loadcss
library
Last synced: 2 months ago
JSON representation
动态导入css,支持promise
- Host: GitHub
- URL: https://github.com/excaliburhan/xp-loadcss
- Owner: excaliburhan
- Created: 2018-01-31T08:04:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T01:57:16.000Z (over 3 years ago)
- Last Synced: 2025-02-19T13:46:35.921Z (over 1 year ago)
- Topics: library
- Language: JavaScript
- Size: 575 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xp-loadcss
动态导入js,支持promise
### Usage
```js
import loadcss from 'xp-loadcss'
// single file
loadcss('https://cdn.bootcss.com/animate.css/3.5.2/animate.css')
.then(() => {
console.log('load success')
})
.catch(() => {
console.log('load error')
})
// multiple files
loadcss(['https://cdn.bootcss.com/animate.css/3.5.2/animate.css', 'https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css'])
.then(() => {
console.log('load success')
})
.catch(() => {
console.log('load error')
})
```