img-load-size

1.1.4 • Public • Published

Welcome to img-load-size 👋

Version Documentation Maintenance License: ISC

介绍 该模块主要针对加载图片功能,同时支持上传图片大小的判断

🏠 Homepage

效果图

  • 限制宽高
  • 限制大小

Install

npm install img-load-size --save-dev

Usage

import ImgLoadSize from 'img-load-size'

Run tests

// 项目入口文件引用插件
import ImgLoadSize from 'img-load-size'
Vue.use(ImgLoadSize)

// vue文件中使用
<ImgLoadSize :width="750" :height="200" :action="upLoadAction" :is-only-width="false"/>

属性

  • width图片宽度限制
  • height图片高度限制
  • action图片上传成功后的回调函数,upLoadAction(base,file),base返回的base64,file返回的formdata格式
  • is-only-width是否只对宽度进行限制
  • min-file-size 文件最小字节限制
  • max-file-size 文件最大字节限制

Author

👤 wangpan

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 wangpan.
This project is ISC licensed.


This README was generated with ❤️ by readme-md-generator

Dependencies (4)

Dev Dependencies (14)

Package Sidebar

Install

npm i img-load-size

Weekly Downloads

1

Version

1.1.4

License

ISC

Unpacked Size

421 kB

Total Files

12

Last publish

Collaborators

  • wangpanhb