New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

image-preview-vue

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-preview-vue

a images viewer for vue.js / 基于Vue.js的图片预览查看器 编程式使用

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
175
increased by146.48%
Maintainers
1
Weekly downloads
 
Created
Source

image-preview-vue

易于使用的PC端图片浏览组件,编程式的调用方式

Example

live demo

Install

npm i image-preview-vue --save

global

// main.js
import imagePreivew from 'image-preview-vue'
Vue.use(imagePreivew)

// your some.vue
export default {
  // ...
  methods:{
    foo(){
      this.$previewImage({
        initIndex:0,
        images:['https://yinodimage.oss-cn-hangzhou.aliyuncs.com/20200229004202.jpg'],
      })
    }
  }
}

import

import imagePreivew from 'image-preview-vue'

imagePreview({
  initIndex:0,
  images:['https://yinodimage.oss-cn-hangzhou.aliyuncs.com/20200229004202.jpg'],
})

Feature

  • 鼠标拖拽缩放图片
  • 高斯模糊背景
  • 图片预加载
  • 分页信息显示

Config

参数名类型描述可选值默认值
initIndexNumber初始化展示图片索引-0
images[String]图片URL数组-[]
isEnableBlurBackgroundBoolean是否开启高斯模糊背景-false
isEnableLoopToggleBoolean是否开启循环切换模式-true
initViewModeString初始化图片展示模式(等于与Object-fit)'contain'/'cover''contain'
shirnkAndEnlargeDeltaRatioNumber缩放点击强度系数-0.2
wheelScrollDeltaRatioNumber鼠标滚轮缩放图片强度系数-1
isEnableImagePageIndicatorBoolean是否显示分页-true

Contributing

如果有发现bug或者希望加入一些功能,请积极提issues,我会尽快回复

License

MIT

灵感来自ElementUI中的Image组件,但是可惜没有编程式的调用方式,所以催生了这个库

FAQs

Package last updated on 28 Jul 2020

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