{"id":19345565,"url":"https://github.com/future-team/eg-imageview","last_synced_at":"2025-08-24T05:15:45.052Z","repository":{"id":57220254,"uuid":"58987638","full_name":"future-team/eg-imageview","owner":"future-team","description":"图片预览","archived":false,"fork":false,"pushed_at":"2017-12-28T06:14:50.000Z","size":12503,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-16T11:48:54.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/future-team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-17T03:31:30.000Z","updated_at":"2017-07-19T10:31:02.000Z","dependencies_parsed_at":"2022-08-29T00:11:46.346Z","dependency_job_id":null,"html_url":"https://github.com/future-team/eg-imageview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-imageview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-imageview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-imageview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-imageview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-team","download_url":"https://codeload.github.com/future-team/eg-imageview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Feg-imageview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259247334,"owners_count":22828229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T04:07:04.517Z","updated_at":"2025-06-11T10:38:38.854Z","avatar_url":"https://github.com/future-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eg-imageview\n\n单张或多张图片预览组件，依赖于eagle-ui组件库。   \n1、支持两种方式的参数传递。一是通过file参数，二是以item的数组方式传入。   \n2、支持放大、缩小、旋转等功能。    \n3、可以指定是否循环展示   \n4、指定是否显示遮罩\n\n## 提示：eagle-ui是3.0.0以下版本请拉取3.0.5版本，以上版本拉取3.0.1。\n\n## UI展示\n\n![ui展示](example/img/test.gif)    \n\n## 参数介绍   \n\n```js\n/**\n * @param file\n * 图片参数数组\n * @default []\n * */\nfile: {\n    name: '',\n    url: ''\n},\nid: '',\n/**\n * @param isMask\n * 是显示遮罩层\n * @default true\n * */\nisMask: true,\n/**\n * @param isLoop\n * 是否循环播放\n * @default true\n * */\nisLoop: true,\n/**\n * @param activeIndex\n * 当前展示图片下标\n * @default 0\n * */\nactiveIndex:0\n/**\n * @param showIcon\n * 配置要显示的操作图标\n * @default Object\n * */\nshowIcon:{\n    /**\n     * @param leftRotate\n     * 是否显示左旋转图标\n     * @default false\n     * */\n    leftRotate:false,\n    /**\n     * @param rightRotate\n     * 是否显示右旋转图标\n     * @default false\n     * */\n    rightRotate:false,\n    /**\n     * @param zoomIn\n     * 是否显示放大图标\n     * @default false\n     * */\n    zoomIn:false,\n    /**\n     * @param zoomOut\n     * 是否显示放大图标\n     * @default false\n     * */\n    zoomOut:false\n}                                \n            \n```   \n\nps： file参数需按上述结构。单张图片支持对象，多张必须为数组。\n\n## 使用\n\n*   一、原有通过file参数的方式传入，单个图片支持数组或者对象，多张图片只支持数组。\n    activeIndex，默认显示的图片下标。\n```js\n\n\timport {ImageView} from '../../src/index.js';\n    import React, { Component ,PropTypes} from 'react';\n    import ReactDom from 'react/lib/ReactDOM';\n    import {Button,Dialog,Toast,Icon} from 'eagle-ui';\n    \n    let file = {\n        name:'test',\n        url:'./src/test.jpg'\n    },\n    showIcon={\n              leftRotate:true,\n               rightRotate:true,\n               zoomIn:true,\n               zoomOut:true\n               };\n    function show(){\n        Dialog.mask('testIamgeView').then(function(){\n            console.log('success');\n            Dialog.close();\n        },function(type){\n            console.log('cancel');\n        });\n    }\n    \n    ReactDom.render(\n        \u003cdiv\u003e\n            \u003cButton onClick={show}\u003e点击我显示图片预览\u003c/Button\u003e\n            \u003cImageView id=\"testIamgeView\" file={file} activeIndex={0} showIcon={showIcon}/\u003e\n        \u003c/div\u003e,\n        document.getElementById('root')\n    );\n\n```   \n\n*   二、以子对象的方式传入   \n\n\n```js\n\u003cImageView id=\"testIamgeView1\" activeIndex={0}\u003e\n    \u003citem url='./src/3.jpg' name='demo1'\u003e\u003c/item\u003e\n    \u003citem url='./src/2.jpg' name='demo2'\u003e\u003c/item\u003e\n    \u003citem url='./src/1.jpg' name='demo3'\u003e\u003c/item\u003e\n\u003c/ImageView\u003e\n```\n\n## 示例演示\n\n下载此项目到本地安装依赖包后执行 **npm run demo** 即可预览。\n\n## update \n\n* `version 3.0.5` 支持eagle-ui3.0以下的版本。\n* `version 3.0.1` 支持eagle-ui3.0以上版本。\n* `version 3.0.0` 增加向左向右旋转功能，支持各个选项配置，不再默认全部展示。\n\n\n* `version 2.0.9` 支持多图片上下翻页和是否展示遮罩层\n* `version 2.0.1` 支持图片放大后拖动，修复图片旋转后位置错误bug，修复图片拉伸变形\n* `version 2.0.2` 支持多张图片的展示和翻页 \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Feg-imageview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-team%2Feg-imageview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Feg-imageview/lists"}