An open API service indexing awesome lists of open source software.

https://github.com/easy-martin/images-mview

移动端图片查看器,基于hammer支持手势
https://github.com/easy-martin/images-mview

h5 hammer imageview react

Last synced: 2 months ago
JSON representation

移动端图片查看器,基于hammer支持手势

Awesome Lists containing this project

README

          

# images-mview

一个基于 React 的图片查看组件,现已迁移到 Vite 构建系统。

## 安装

```bash
yarn add images-mview
# 或
npm install images-mview
```

## 开发

```bash
# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 构建库文件
npm run build:lib

# 构建演示应用
npm run build

# 预览构建结果
npm run preview
```

## 使用示例

```jsx
import React, { useState } from 'react';
import ImagesView from 'images-mview';
import "images-mview/lib/images-mview.es.css"

function App() {
const [visible, setVisible] = useState(false);
return (


setVisible(true)}>查看图片
setVisible(false)}
imageList={[
'https://example.com/image1.jpg',
'https://example.com/image2.jpg',
'https://example.com/image3.jpg',
]}
/>

);
}

export default App;
```

## 构建系统迁移

项目已从 Create React App + Rollup 迁移到 Vite:

- ✅ 更快的开发服务器启动
- ✅ 热模块替换 (HMR)
- ✅ 更快的构建速度
- ✅ 支持 ES 模块和 UMD 格式输出
- ✅ 内置 Less 支持

## API 文档

待补充...