This commit is contained in:
expdsn 2024-09-27 17:17:56 +08:00
parent bd2d533813
commit f87299ac6f
1 changed files with 13 additions and 13 deletions

View File

@ -4,11 +4,10 @@ import { VueCropper } from 'vue-cropper'
import 'vue-cropper/dist/index.css' import 'vue-cropper/dist/index.css'
import upload from './upload' import upload from './upload'
import { v4 as uuid } from "uuid" import { v4 as uuid } from "uuid"
import { MdCroprotateRound } from "oh-vue-icons/icons"; import { MdCroprotateRound, BiPlusLg } from "oh-vue-icons/icons";
import { OhVueIcon, addIcons } from 'oh-vue-icons' import { OhVueIcon, addIcons, } from 'oh-vue-icons'
import NativeColorPicker from './NativeColorPicker' import NativeColorPicker from './NativeColorPicker'
addIcons(MdCroprotateRound, BiPlusLg)
addIcons(MdCroprotateRound)
export default defineComponent({ export default defineComponent({
@ -62,15 +61,15 @@ export default defineComponent({
watch( watch(
fillColor, fillColor,
(e: string) => { (e: string) => {
const elements = document.querySelectorAll('.cropper-crop-box') const elements = document.querySelectorAll('.cropper-crop-box')
elements.forEach((element: any) => { elements.forEach((element: any) => {
element.style.backgroundColor = e // 修改颜色为蓝色 element.style.backgroundColor = e // 修改颜色为蓝色
}) })
}, },
{ {
immediate: true immediate: true
} }
) )
return () => ( return () => (
<> <>
<Modal <Modal
@ -96,7 +95,7 @@ export default defineComponent({
img={originFile.value} img={originFile.value}
autoCrop={true} autoCrop={true}
fillColor={fillColor.value} fillColor={fillColor.value}
/> />
</div> </div>
<div class="flex justify-between w-[250px]"> <div class="flex justify-between w-[250px]">
@ -138,7 +137,7 @@ export default defineComponent({
</svg> </svg>
</span> </span>
</div> </div>
<NativeColorPicker value={fillColor.value} onUpdate:value={e => fillColor.value = e} transparent={true}/> <NativeColorPicker value={fillColor.value} onUpdate:value={e => fillColor.value = e} transparent={true} />
{/* {props.colorList && ( {/* {props.colorList && (
<div class="w-[250px] flex justify-center"> <div class="w-[250px] flex justify-center">
<NativeColorPicker <NativeColorPicker
@ -152,11 +151,12 @@ export default defineComponent({
</div> </div>
</Modal > </Modal >
<div class="w-full h-full bg-red-500" <div class="w-full h-full bg-white flex items-center justify-center"
onClick={() => { onClick={() => {
inputRef.value?.click?.() inputRef.value?.click?.()
}} }}
> >
<OhVueIcon name={BiPlusLg.name} fill='#666666' scale={2}></OhVueIcon>
</div> </div>
<input <input
ref={inputRef} ref={inputRef}