Compare commits

..

5 Commits

Author SHA1 Message Date
LiuJiaNan 715b2c8d72 fix(useDeleteFile): 修正删除文件接口路径及请求方法
- 将单个文件删除接口路径从 getDelete 改为 delete
- 将批量文件删除接口路径从 getIds 改为 ids
- 将请求方法从 GET 修改为 DELETE
- 保持删除请求逻辑不变,确保正确触发删除操作
2026-07-27 08:45:52 +08:00
LiuJiaNan 9c82b16789 1.3.25 2026-07-23 14:14:36 +08:00
LiuJiaNan 424ec379bc refactor(SeamlessScroll): 重命名自动滚动属性为 isAutoScroll
- 将自动滚动开关属性由 value 改为 isAutoScroll
- 更新代码中所有 value 相关判断为 isAutoScroll
- 修改类型定义文件中属性名称以保持一致
- 优化注释说明,明确使用 isAutoScroll 控制自动滚动
- 保证悬停停止和滚动启动逻辑使用新属性名
2026-07-23 14:14:29 +08:00
LiuJiaNan e902a05101 1.3.24 2026-07-21 17:09:46 +08:00
LiuJiaNan 92da66ffd4 fix(hooks): 修正删除文件请求的接口和方法
- 将单文件删除接口路径从 imgFiles/delete 改为 imgFiles/getDelete
- 将批量删除接口路径从 imgFiles/ids 改为 imgFiles/getIds
- 删除请求方法从 delete 改为 get
- 更新请求调用以匹配新的接口和方法
2026-07-21 17:09:40 +08:00
3 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "zy-react-library", "name": "zy-react-library",
"private": false, "private": false,
"version": "1.3.23", "version": "1.3.25",
"type": "module", "type": "module",
"description": "", "description": "",
"author": "LiuJiaNan", "author": "LiuJiaNan",

View File

@ -2,7 +2,7 @@ import type { ForwardRefExoticComponent, RefAttributes } from "react";
export interface SeamlessScrollProps { export interface SeamlessScrollProps {
/** 是否开启自动滚动,默认 true */ /** 是否开启自动滚动,默认 true */
value?: boolean; isAutoScroll?: boolean;
/** 原始数据列表 */ /** 原始数据列表 */
list: unknown[]; list: unknown[];
/** 步进速度step 需是单步大小的约数,值越大滚动的越快,默认 1 */ /** 步进速度step 需是单步大小的约数,值越大滚动的越快,默认 1 */

View File

@ -6,7 +6,7 @@ import { throttle } from "throttle-debounce";
*/ */
const SeamlessScroll = forwardRef((props, ref) => { const SeamlessScroll = forwardRef((props, ref) => {
const { const {
value = true, isAutoScroll = true,
list = [], list = [],
step = 1, step = 1,
limitScrollNum = 3, limitScrollNum = 3,
@ -242,7 +242,7 @@ const SeamlessScroll = forwardRef((props, ref) => {
* *
* @description * @description
* 1. 计算并设置容器的宽度和高度 * 1. 计算并设置容器的宽度和高度
* 2. 如果需要滚动且 value true启动滚动动画 * 2. 如果需要滚动且 isAutoScroll true启动滚动动画
* *
* @note * @note
* - React useEffect 中调用可能存在 DOM 未完全渲染的情况 * - React useEffect 中调用可能存在 DOM 未完全渲染的情况
@ -315,7 +315,7 @@ const SeamlessScroll = forwardRef((props, ref) => {
cancle(); cancle();
}; };
const hoverStop = hover && value && isScroll; // 是否启用悬停停止功能 const hoverStop = hover && isAutoScroll && isScroll; // 是否启用悬停停止功能
/** /**
* 重置滚动状态 * 重置滚动状态
@ -375,23 +375,23 @@ const SeamlessScroll = forwardRef((props, ref) => {
* - 然后启动滚动 * - 然后启动滚动
*/ */
useEffect(() => { useEffect(() => {
if (isScroll && value && (realBoxHeight > 0 || realBoxWidth > 0) && !isHoverRef.current) { if (isScroll && isAutoScroll && (realBoxHeight > 0 || realBoxWidth > 0) && !isHoverRef.current) {
move(); move();
} }
}, [realBoxHeight, realBoxWidth]); }, [realBoxHeight, realBoxWidth]);
/** /**
* 监听 value 属性变化 * 监听 isAutoScroll 属性变化
* value 变化时启动或停止滚动 * isAutoScroll 变化时启动或停止滚动
*/ */
useEffect(() => { useEffect(() => {
if (value) { if (isAutoScroll) {
startMove(); startMove();
} }
else { else {
stopMove(); stopMove();
} }
}, [value]); }, [isAutoScroll]);
/** /**
* 监听 count 属性变化 * 监听 count 属性变化