Socket
Socket
Sign inDemoInstall

@wm-hosp/weimeng-hosp-preview

Package Overview
Dependencies
Maintainers
5
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wm-hosp/weimeng-hosp-preview

微萌前端公用图片预览组件


Version published
Weekly downloads
0
decreased by-100%
Maintainers
5
Weekly downloads
 
Created
Source

Installation

npm install @wm-hosp/weimeng-hosp-preview --save

Usage

import * as React from 'react';
import { openPicturePreview } from '@wm-hosp/weimeng-hosp-preview';

class App extends React.Component<any, any> {
  constructor() {
    super();
  }

  render() {
    return (
      <div>
        <button
          onClick={() => {
            openPicturePreview({
              imgList: [
                {
                  title: '',
                  src: '',
                  alt: '',
                  showOtherInfo: [
                    {
                      label: '',
                      value: '',
                    },
                  ],
                },
              ],
            });
          }}
        >
          预览图片
        </button>
      </div>
    );
  }
}

Props

propstypedefaultdescriptionrequired
imgListimgListProps[][]image source arraytrue
currentClickImgstring-current image titlefalse
noNavbarbooleanfalseto not render the navbarfalse
noToolbarbooleanfalseto not render the toolbarfalse
noFooterbooleanfalseto not render the entire footerfalse
changeablebooleantruewheather to show change buttonfalse
customToolbar(defaultToolbarConfigs: ToolbarConfig[]) => ToolbarConfig[]-customer toolbarfalse
zoomSpeednumber0.05zoom speedfalse
defaultScalenumber1set default scalefalse

imgListProps

propstypedefaultdescriptionrequired
srcstring-image sourcetrue
altstring-image descriptionfalse
titlestring-image titefalse
downloadUrlstring-image downlaod urlfalse
showOtherInfoshowOtherInfoProps-image descriptionfalse

注:src 如果是 pdf 链接格式,如果带*&name*则是原链接就带.pdf 后缀,若不存在则是手动添加,运行会将.pdf 后缀去掉

showOtherInfoProps

propstypedefaultdescriptionrequired
lablestring-descriptionfalse
valuestring-descriptionfalse

ToolbarConfig

propstypedefaultdescriptionrequired
keystring-tool keytrue
renderReact.ReactNode-tool renderfalse
onClickfunction-callback function when action is clickedfalse

Keywords

FAQs

Package last updated on 09 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc