vue-img-tag

A simple vue2 component, just for img preview, can be used to file input preview, support lazyload
1,310 4
Install
npm install vue-img-tag
Latest Version:3.7.0
Vue:2
License:MIT
Last Updated:Jul 28, 2019
Links: GitHub  ·  npm
Maintainer: livelybone

vue-img-tag

NPM Version Download Month gzip with dependencies: 2.3kb pkg.module lazyload supported ssr supported

pkg.module supported, which means that you can apply tree-shaking in you project

A simple vue2 component, just for img preview, can be used to image input preview

repository

https://github.com/livelybone/vue-img-tag.git

Demo

https://livelybone.github.io/vue/vue-img-tag/

Example

See: example

Installation

npm i -S vue-img-tag

Global name

VueImgTag

Usage

// import all
import VueImgTag from 'vue-img-tag';

// Global register
Vue.component('img-tag', VueImgTag);

// Local register
new Vue({
  components:{VueImgTag}
})

Props

Name Type DefaultValue Description
lazy Boolean false Enable lazy mode or not
loadingImg String none Can be url or color(should be rgb, rgba or hex)
errorImg String none Don't set to color, only url allowed
src [String, FileList, File, Promise] none
preventValue Number 0 The boundary condition
event Object defaultConf Config of event which is use to judge whether img should load or not, especially useful when lazy mode is enabled
const defaultConf = {
  eventName: 'scroll', // The event listened to
  eventTarget: window, // what dom do event triggered on
}

Related Packages

vue-picture-input

Mobile-friendly picture file input component with image preview and drag and dro...

131,226 883
v-preview-image

一个基于vue3的图片预览插件,可以缩放图片,移动图片,旋转图片,目前只支持pc端。

3,455
vue-preview-image

— A vue picture preview component.

1,572 1
xqlight

A dependency-free image lightbox for the browser, with a Vue 2/3 wrapper.

862 0

Version History

Version Released Vue License
3.7.0 ^2.5.16 MIT
3.6.0 ^2.5.16 MIT
3.5.1 ^2.5.16 MIT
3.5.0 ^2.5.16 MIT
3.4.0 ^2.5.16 MIT