Coder Social home page Coder Social logo

guojikun / preview-image Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 1.52 MB

vue 组件-图片预览插件

Home Page: https://blog.jikun.dev/docs/preview-image.html

License: MIT License

JavaScript 1.69% HTML 1.43% Vue 78.40% TypeScript 18.48%
vue component preview preview-image image

preview-image's Introduction

preview-image

Vue 图片预览组件

vue2.x 请使用 @1.x 版本

Github New issue

安装

npm i fox-preview-image
# or
yarn add fox-preview-image
# or
pnpm add fox-preview-image

引入组件

import foxPreviewImage from 'fox-preview-image'
import 'fox-preview-image/lib/style.css'
Vue.use(foxPreviewImage)

基础使用

<fox-preview-image v-model="visiable" :src="imageSrc" z-index="9000"></fox-preview-image>

演示地址

文档以及 demo 地址

API

属性 说明 参数类型 默认值
src 预览图片的地址 string/string[] -
modelValue/v-model 是否显示预览窗口 boolean false
initial-index 默认显示图片的下标 number 0
z-index 预览窗口的层级-css 的 zIndex number 9000
showToolbar 控制 toolbar 的显示和隐藏 boolean true

更新日志

v2.9.0

Feat:

  • 增加 showToolbar 属性,用于控制工具栏的显示和隐藏
  • 移除了容器的圆角属性

Refactor:

  • 重构了代码,将重复代码替换为函数
  • 移除了 console 语句

v2.8.0

Feat:

  • 更改打包后文件的格式,es 格式文件后缀改为 .mjs

v2.6.0

Feat:

  • 增加下载功能
  • 统一 icon

v2.4.1

Fix:

  • 修复 css 导入错误

v2.4.0

Feat:

  • 增加默认显示第几张图片的功能

v2.3.0

Feat:

  • 增加显示当前图片下标的功能(仅在多图下显示)

v2.0.0

Feat:

  • 增加 vue3 支持(安装:npm i fox-preview-image@next)

v1.1.3

Refactor:

  • 删除冗余代码

v1.1.2

Fix:

  • 修复火狐浏览器拖拽失效的问题

v1.1.1

Feat:

  • 支持鼠标滚轮放大缩小

v1.1.0

feat:

  • 增加缩放倍数显示

v1.0.2

Fix:

  • 修复当预览的图片为 1 张时扔显示左右切换按钮的问题

v1.0.1

Fix:

  • 修复拖拽时图片未完全跟随鼠标的 bug

v1.0.0

Feat:

preview-image's People

Contributors

guojikun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

preview-image'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.