diff --git a/packages/effects/common-ui/src/components/cropper/cropper.vue b/packages/effects/common-ui/src/components/cropper/cropper.vue new file mode 100644 index 000000000..dc79d463c --- /dev/null +++ b/packages/effects/common-ui/src/components/cropper/cropper.vue @@ -0,0 +1,956 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/effects/common-ui/src/components/cropper/index.ts b/packages/effects/common-ui/src/components/cropper/index.ts new file mode 100644 index 000000000..58a8f0ab6 --- /dev/null +++ b/packages/effects/common-ui/src/components/cropper/index.ts @@ -0,0 +1 @@ +export { default as VCropper } from './cropper.vue'; diff --git a/packages/effects/common-ui/src/components/index.ts b/packages/effects/common-ui/src/components/index.ts index 9ff0d5ee1..33f32bd04 100644 --- a/packages/effects/common-ui/src/components/index.ts +++ b/packages/effects/common-ui/src/components/index.ts @@ -2,6 +2,7 @@ export * from './api-component'; export * from './captcha'; export * from './col-page'; export * from './count-to'; +export * from './cropper'; export * from './ellipsis-text'; export * from './icon-picker'; export * from './json-viewer'; diff --git a/playground/src/locales/langs/en-US/examples.json b/playground/src/locales/langs/en-US/examples.json index 42a42d54e..958b0c83f 100644 --- a/playground/src/locales/langs/en-US/examples.json +++ b/playground/src/locales/langs/en-US/examples.json @@ -75,5 +75,8 @@ }, "function": { "contentMenu": "Content Menu" + }, + "cropper": { + "title": "Cropper" } } diff --git a/playground/src/locales/langs/zh-CN/examples.json b/playground/src/locales/langs/zh-CN/examples.json index 8808b5a9a..3de48e214 100644 --- a/playground/src/locales/langs/zh-CN/examples.json +++ b/playground/src/locales/langs/zh-CN/examples.json @@ -75,5 +75,8 @@ }, "function": { "contentMenu": "上下文菜单" + }, + "cropper": { + "title": "图片裁剪" } } diff --git a/playground/src/router/routes/modules/examples.ts b/playground/src/router/routes/modules/examples.ts index 5361fcc8f..017b2c22f 100644 --- a/playground/src/router/routes/modules/examples.ts +++ b/playground/src/router/routes/modules/examples.ts @@ -337,6 +337,15 @@ const routes: RouteRecordRaw[] = [ title: $t('examples.function.contentMenu'), }, }, + { + name: 'CropperDemo', + path: '/examples/cropper', + component: () => import('#/views/examples/cropper/index.vue'), + meta: { + icon: 'mdi:crop', + title: $t('examples.cropper.title'), + }, + }, ], }, ]; diff --git a/playground/src/views/examples/cropper/index.vue b/playground/src/views/examples/cropper/index.vue new file mode 100644 index 000000000..615c95113 --- /dev/null +++ b/playground/src/views/examples/cropper/index.vue @@ -0,0 +1,138 @@ + + + + + + + 当前裁剪比例: + + + 上传图片 + + + + + + + + + + 裁剪 + + + 下载图片 + + + + + + + + + + +