async theme

This commit is contained in:
tangly1024
2023-06-04 17:17:38 +08:00
parent 70ef50c6d0
commit e791752e68
23 changed files with 127 additions and 136 deletions

View File

@@ -9,12 +9,10 @@ export default function Live2D() {
useEffect(() => {
if (BLOG.WIDGET_PET) {
// setLive2DLoaded(true)
// console.log('加载宠物挂件')
Promise.all([
loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js')
]).then((e) => {
if (window?.loadlive2d) {
if (typeof window?.loadlive2d !== 'undefined') {
// https://github.com/xiazeyu/live2d-widget-models
loadlive2d('live2d', BLOG.WIDGET_PET_LINK)
}