
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
image-preview-vue
Advanced tools
易于使用的PC端图片浏览组件,编程式的调用方式
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'],
})
参数名 | 类型 | 描述 | 可选值 | 默认值 |
---|---|---|---|---|
initIndex | Number | 初始化展示图片索引 | - | 0 |
images | [String] | 图片URL数组 | - | [] |
isEnableBlurBackground | Boolean | 是否开启高斯模糊背景 | - | false |
isEnableLoopToggle | Boolean | 是否开启循环切换模式 | - | true |
initViewMode | String | 初始化图片展示模式(等于与Object-fit) | 'contain'/'cover' | 'contain' |
shirnkAndEnlargeDeltaRatio | Number | 缩放点击强度系数 | - | 0.2 |
wheelScrollDeltaRatio | Number | 鼠标滚轮缩放图片强度系数 | - | 1 |
isEnableImagePageIndicator | Boolean | 是否显示分页 | - | true |
如果有发现bug或者希望加入一些功能,请积极提issues,我会尽快回复
MIT
灵感来自ElementUI中的Image组件,但是可惜没有编程式的调用方式,所以催生了这个库
FAQs
a images viewer for vue.js / 基于Vue.js的图片预览查看器 编程式使用
The npm package image-preview-vue receives a total of 100 weekly downloads. As such, image-preview-vue popularity was classified as not popular.
We found that image-preview-vue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.