npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

upload-img-cropper-js

v1.0.9

Published

<!-- * @Author: maxiaodan * @Date: 2021-01-13 17:48:06 * @LastEditTime: 2021-03-09 13:43:28 * @LastEditors: maxiaodan --> ## 配置环境 vue@2+(或者vue@1)、webpack、es6

Downloads

3

Readme

配置环境

vue@2+(或者vue@1)、webpack、es6

安装

npm install upload-img-cropper-js

使用

props

| 名称 | 类型| 默认 | 是否必传字段| 说明 | | --- | --- | --- | --- | --- | | numLimit | Number | 1 | 否 |允许上传的最大个数 | sizeLimit |Number | 10 | 否 |允许上传的最大单个文件的大小 | imgBaseUrl | String | | 是 | 图片上传的服务器路径 | introduceImg | Array | function(){return []} | 否 | 外部传入的图片信息,传入数据格式:[...{...,filePath:图片路径, ... }...] | | postCropWidth | Number | 0 | 否 | 裁剪后图片宽度 | | postCropHeight| Number | 0 | 否 | 裁剪后图片高度 | | isCompress| Boolean | true | 否 | 图片是否压缩 | | compress| String | 0.8 | 否 | 压缩率 | | isCircle| Boolean | false | 否 | 是否裁剪圆形的图片,默认裁剪的是正方形或者长方形 |

Events

| 名称 | 说明 | | --- | --- | | change | 图片上传成功以后,参数{id:,file:图片的信息} | | delete | 点击删除图片之后,参数(file)|

使用示例

<upload-img-cropper 
    :imgBaseUrl="`http://baidu.com/`" 
    :isCircle="true">
</upload-img-cropper>

// 或者 组件里面可以自定义上传的样式
 <upload-img-cropper 
    :imgBaseUrl="`http://test.zhihuifh.cn/`"
    :numLimit="1"
    :isCircle="true"
    @change="getImages($event)" 
    @delete="deleteFile($event)">
  <template v-slot:selecttype>
    <span>更换</span>
  </template>
</upload-img-cropper>

getImages(data) {
    console.log(data)
},
deleteFile(file) {
  console.log(file)
}