部分公共组件配置化

This commit is contained in:
tangly1024.com
2023-11-08 19:05:35 +08:00
parent f96aa2242f
commit b2759c6d5e
34 changed files with 301 additions and 239 deletions

View File

@@ -1,4 +1,4 @@
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import { loadExternalResource } from '@/lib/utils'
import { useEffect } from 'react'
@@ -6,12 +6,14 @@ import { useEffect } from 'react'
* 二维码生成
*/
export default function QrCode({ value }) {
const qrCodeCDN = siteConfig('QR_CODE_CDN')
useEffect(() => {
let qrcode
if (!value) {
return
}
loadExternalResource(BLOG.QR_CODE_CDN, 'js').then(url => {
loadExternalResource(qrCodeCDN, 'js').then(url => {
const QRCode = window.QRCode
qrcode = new QRCode(document.getElementById('qrcode'), {
text: value,