在package.json中添加highlight.js和katex依赖,并更新pnpm-lock.yaml以反映其版本变化;移除Swiper组件中的不必要API调用以简化代码。

This commit is contained in:
神秘人
2025-04-18 20:45:32 +08:00
parent 3afec7c8cc
commit 108a627296
4 changed files with 14 additions and 12 deletions

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
public-hoist-pattern[]=*@heroui/*

View File

@@ -21,6 +21,8 @@
"feed": "^4.2.2",
"framer-motion": "^12.7.4",
"github-markdown-css": "^5.6.1",
"highlight.js": "^11.11.1",
"katex": "^0.16.22",
"mdast-util-gfm-autolink-literal": "^2.0.0",
"next": "15.1.7",
"next-nprogress-bar": "^2.3.13",

16
pnpm-lock.yaml generated
View File

@@ -44,6 +44,12 @@ importers:
github-markdown-css:
specifier: ^5.6.1
version: 5.8.1
highlight.js:
specifier: ^11.11.1
version: 11.11.1
katex:
specifier: ^0.16.22
version: 0.16.22
mdast-util-gfm-autolink-literal:
specifier: ^2.0.0
version: 2.0.1
@@ -2119,8 +2125,8 @@ packages:
resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==}
hasBin: true
katex@0.16.18:
resolution: {integrity: sha512-LRuk0rPdXrecAFwQucYjMiIs0JFefk6N1q/04mlw14aVIVgxq1FO0MA9RiIIGVaKOB5GIP5GH4aBBNraZERmaQ==}
katex@0.16.22:
resolution: {integrity: sha512-XCHRdUw4lf3SKBaJe4EvgqIuWwkPSo9XoeO8GjQW94Bp7TWv9hNhzZjZ+OH9yf1UmLygb7DIT5GSFQiyt16zYg==}
hasBin: true
lilconfig@3.1.3:
@@ -5603,7 +5609,7 @@ snapshots:
jiti@1.21.7: {}
katex@0.16.18:
katex@0.16.22:
dependencies:
commander: 8.3.0
@@ -5875,7 +5881,7 @@ snapshots:
dependencies:
'@types/katex': 0.16.7
devlop: 1.1.0
katex: 0.16.18
katex: 0.16.22
micromark-factory-space: 2.0.1
micromark-util-character: 2.1.1
micromark-util-symbol: 2.0.1
@@ -6249,7 +6255,7 @@ snapshots:
'@types/katex': 0.16.7
hast-util-from-html-isomorphic: 2.0.0
hast-util-to-text: 4.0.2
katex: 0.16.18
katex: 0.16.22
unist-util-visit-parents: 6.0.1
vfile: 6.0.3

View File

@@ -5,19 +5,12 @@ import { useState, useEffect, useRef } from "react";
import { BiChevronRight } from "react-icons/bi";
import { BiChevronLeft } from "react-icons/bi";
import { Swiper as SwiperType } from "@/types/app/swiper";
import { getSwiperListAPI } from "@/api/swiper";
export default ({ data, className }: { data: SwiperType[], className?: string }) => {
const [current, setCurrent] = useState(0);
const [isHovered, setIsHovered] = useState(false);
const intervalRef = useRef<NodeJS.Timeout | null>(null);
useEffect(() => {
getSwiperListAPI().then((res) => {
console.log(res, 444)
})
}, [])
const handlePrev = () => {
setCurrent((current) => {
if (current === 0) {