mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 15:10:23 +00:00
懒加载占位图可配置
This commit is contained in:
@@ -1,21 +1,7 @@
|
||||
import BLOG from '@/blog.config'
|
||||
import Head from 'next/head'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
|
||||
/**
|
||||
* 默认懒加载占位图
|
||||
*/
|
||||
const loadingSVG = (
|
||||
<svg
|
||||
width="100"
|
||||
height="100"
|
||||
viewBox="0 0 100 100"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="#ccc"
|
||||
>
|
||||
<circle cx="50" cy="50" r="42" strokeWidth="8" />
|
||||
</svg>
|
||||
)
|
||||
|
||||
/**
|
||||
* 图片懒加载
|
||||
* @param {*} param0
|
||||
@@ -26,7 +12,7 @@ export default function LazyImage({
|
||||
id,
|
||||
src,
|
||||
alt,
|
||||
placeholderSrc = loadingSVG,
|
||||
placeholderSrc = BLOG.IMG_LAZY_LOAD_PLACEHOLDER,
|
||||
className,
|
||||
width,
|
||||
height,
|
||||
|
||||
Reference in New Issue
Block a user