waynecz/vue-img-inputer
waynecz/vue-img-inputer has 558 GitHub stars and 123 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-17 03:52 UTC. Last push 2019-09-06.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
🏞 A graceful image type inputer / uploader
Developer ToolsREADME.md
Original
点击查看中文文档 | Have a glance at Demo
Intro
<input type="file" />like, only support single image- auto-upload support
- drop-select / preview / use as
<img />as well - optional skins
Screenshots
Install and Usage
npm install vue-img-inputer
import ImgInputer from 'vue-img-inputer'
import 'vue-img-inputer/dist/index.css'
Vue.component('ImgInputer', ImgInputer)
<img-inputer v-model="file" theme="light" size="large"/>
API
Auto upload related
auto-upload: Boolean
set to enable auto-uploadaction: String
request URLupload-key: String
default:file
key name in form-dataextra-data: Object
extra data been appended in request's form-dataheaders: Object
additional headers of requestwith-cookie: Boolean
whether cookies will been senton-start: Function
params: func ( file )
hook function when upload starton-progress: Function
params: func ( event, file )
hook function when uploading, get progress byevent.percenton-success: Function
params: func ( res, file )
hook function when upload success,resis response from serveron-error: Function
params: func ( err, file )
hook function when upload failed
Input tag related
accept: String
default:image/*,video/*;
suggest to set a specific value likeimage/jpg,image/gif;for wildcard will lead to a serious delayplaceholder: String
default:Drop file here or clickid: String
default: random string in 4 length
id of input tagreadonly: Booleancapture: Boolean
default:false
whether use camera directly in mobilemax-size: Number
default: 5120
max-size of image (KB)name: Boolean
name of input tagany input's attribute
any input's original attributes set on component will be inherited by inner input tag
UI related
img-src: String
image resource let component behavior like<img />theme: String
default:materialtwo themes optional (light / material)size: String small / normal / largeicon: String
clip / img / img2ali-icon: String
if you use iconfont.cn, set unicode of any icon to customno-mask: Boolean
remove mask when hoverno-hover-effect: Boolean
remove all hover effect (include text) when hoverbottom-text: String
default:Drop file here or click to change
text in the bottom when hoverno-multiple-text: String
default:Not support multiple files
visible only the state isreadonly, cover bottom-textexceed-size-text: String
default:The size of file should less than: ${maxSize}
visible only the state isreadonly, cover bottom-textno-action-text: String
default:Action hasn't set up yet
visible only the state isreadonly, cover bottom-textreadonly-tip-text: String
default:Readonly
visible only the state isreadonly, cover bottom-text
Events
onChange: Function
params: func ( file, fileName )
hook function when file selectedonExceed: Function
params: func ( file )
hook function when file exceed max-size
Methods
reset
reset componet but will not clearimg-src