ImgEditBtn.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <a-button @click="handleClick" class="image-edit-btn">
  3. 编辑图片
  4. </a-button>
  5. <a-modal v-model:visible="visible" @ok="handleOk" @cancel="handleCancel" modal-class="image-editor-modal" body-class="image-editor-body" width="70%">
  6. <template #title>
  7. 编辑图片
  8. </template>
  9. <div style="padding:20px; height: 100%;">
  10. <TuiImageEditor :image_url="image_url" />
  11. </div>
  12. </a-modal>
  13. </template>
  14. <script setup>
  15. import { ref } from 'vue';
  16. import logo from '../../assets/images/comfyui-logo.png'
  17. import TuiImageEditor from './TuiImageEditorVue3.vue';
  18. const props = defineProps({
  19. image_url: String
  20. });
  21. const visible = ref(false);
  22. const handleClick = () => {
  23. visible.value = true;
  24. };
  25. const handleOk = () => {
  26. visible.value = false;
  27. };
  28. const handleCancel = () => {
  29. visible.value = false;
  30. }
  31. </script>
  32. <style scoped>
  33. .image-edit-btn{
  34. width: 100px;
  35. border-radius: 30px;
  36. color: #353535;
  37. }
  38. </style>
  39. <style>
  40. .image-editor-modal{
  41. }
  42. .arco-modal-body.image-editor-body{
  43. width: 100%;
  44. /* height: 900px; */
  45. height: 840px;
  46. /* height: 80vh; */
  47. padding: 0;
  48. }
  49. .tui-image-editor-submenu-item > li > .tui-image-editor-button > div > .tie-mask-image-file {
  50. display: block !important;
  51. }
  52. </style>