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支持手势
- Host: GitHub
- URL: https://github.com/easy-martin/images-mview
- Owner: Easy-Martin
- Created: 2020-07-15T05:09:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T02:22:10.000Z (about 2 years ago)
- Last Synced: 2025-04-20T18:05:19.071Z (about 1 year ago)
- Topics: h5, hammer, imageview, react
- Language: JavaScript
- Homepage: https://easy-martin.github.io/images-mview/
- Size: 655 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 文档
待补充...