Git Product home page Git Product logo

image-ipreview's Introduction

image-ipreview

一款基于vue的桌面端轻量图片预览插件。 1.欢迎大家使用~,觉得还行的,恳请给个star,谢谢! 2.如有问题,请提issue,我会持续迭代。

特性

  1.支持缩放,旋转,原图查看等
  2.支持鼠标滚轮缩放
  3.自带节流机制,兼顾性能
  4.支持鼠标拖动预览图查看

安装

npm install image-ipreview 

用法

import ImageIpreview from 'image-ipreview';
import 'image-ipreview/lib/image-ipreview.css';
Vue.use(ImageIpreview);

// 组件中使用实例
...
<template>
  <div id="app">
    <image-ipreview
     :url="url"
     :isMouseWheel="true"
     :isShowToolBar="true"
     :closeOnPressEscape="true"
     style="width: 300px;"
     :previewSrcList="srcList"
    />
  </div>
</template>

<script>

export default {
  name: 'App',
  data() {
    return {
      url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
      srcList: [
        'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
        'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg',
        'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'
      ]
    };
  }
};
</script>
...

配置

属性名 类型 描述 是否必填 默认值
url string 图片地址
closeOnPressEscape boolean esc键关闭预览 - true
isShowToolBar boolean 是否展示工具栏 - true
isMouseWheel boolean 是否开启鼠标滚轮缩放 - false
previewSrcList Array 开启图片预览功能 -

效果

image image image

image-ipreview's People

Contributors

huanganfree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jierucker

image-ipreview's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.