sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
18 lines (17 loc) • 594 B
JavaScript
import { getAvailableImperative } from '../../use';
import { defaultConfig } from '../config';
import { defaultCropImageProps } from '../crop-image/common';
export const defaultCropImageAgentProps = () => ({
...defaultCropImageProps(),
id: 'cropImage',
...defaultConfig.cropImageAgent,
});
export const imperativeName = 'cropImage';
const cropImage = (options) => {
const { id = defaultCropImageAgentProps().id } = options;
const imperative = getAvailableImperative(imperativeName, id);
if (imperative) {
imperative.show(options);
}
};
export { cropImage };