1.0.1 • Published 5 years ago

wx-tailor v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

✂ A simple image cropper for Wechat Miniprogram

Usage

Get wx-tailor on NPM

npm i -S wx-tailor --production

Include wx-tailor in \<your page>.json

{
  "usingComponents": {
    "tailor": "wx-tailor"
  }
}

Using wx-tailor in \<your page>.wxml

<tailor src="{{imageSrc}}" />

Attribute

AttributeDescriptionTypeAccepted ValuesDefault
widthwidth to be cropped(expect rpx, px, vw or vh)String--400rpx
heightheight to be cropped(expect rpx, px, vw or vh)String--400rpx
srcimage resouce to be cropped(expect wechat's temporary file path)String----
cancelTexttext content of cancel buttonString--取消
confirmTexttext content of confirm buttonString--确定
cancelColortext color of cancel buttonString--#000000
confirmColortext color of confirm buttonString--#FFFFFF
cancelBgColorbackground color of cancel buttonString--#FFFFFF
confirmBgColorbackground color of confirm buttonString--#09BB07

Events

Event NameDescriptionParameters
canceltriggers when the cancel button is clicked--
confirmtriggers when the confirm button is clickedwechat's temporary file path of cropped image
errortriggers when error occurreddetails of the error