一个自定义元素,用于裁剪正方形图像。返回 x、y、宽度和高度。
This loads an image and creates a crop area that user can modify. An event is fired with x, y, width, and height as the crop area changes.
$ npm install --save @github/image-crop-element
document.addEventListener('image-crop-change', function (event){
console.log(
'Crop area changed.',
event.detail.x,
event.detail.y,
event.detail.width,
event.detail.height
)
})The elements HTML structure is initialized in a Shadow DOM, so it is impossible to apply CSS to it. If you need to change the element's default style for any reason, you should open up a new issue (or a pull request!), describing your use case, and we'll work with you on solving the problem.
Browsers without native custom element support require a polyfill. Legacy browsers require various other polyfills. See examples/index.html for details.
暂无开放 Issues,或尚未同步最近议题。