dfws-taro-crop

东方网升taro裁切组件

Usage no npm install needed!

<script type="module">
  import dfwsTaroCrop from 'https://cdn.skypack.dev/dfws-taro-crop';
</script>

README

东方网升 taro 版本裁切组件

发布

  1. 更改package.json版本
  2. yarn run build:compoent
  3. npm publish 注:镜像源需切换回NPM官方源

链接

示例

  • yarn
  • yarn run dev:weapp

使用之前

该组件依赖于taro,使用之前请配置taro。

何时使用

  • 小程序需要裁切图片时

API

<ImageCropper save={this.save} imgSrc={this.state.imgSrc} cancel={this.cancel} />
save = (res) => {
    console.log(res)
  }
  cancel=()=>{
    this.setState({
      imgSrc:'
    })
  }

upload props

参数 说明 类型 默认值
imgSrc 图片地址 string ''
save 保存图片裁切操作,返回裁切后信息 function -
cancel 取消图片裁切操作 function -
cancelText 取消按钮文案 string 取消
saveText 保存按钮文案 string 保存
handleStyle 操作栏样式 json {}
cancelStyle 取消按钮样式 json {}
saveStyle 保存按钮样式 json {}