Merge pull request 'fix: 修改预览图片的功能;' (#41) from yangws into main

Reviewed-on: #41
This commit is contained in:
yangws 2024-07-18 15:43:58 +08:00
commit 4f26bfd7f6
1 changed files with 5 additions and 8 deletions

View File

@ -94,8 +94,6 @@ const options = reactive({
})
//
const show = ref(false)
//
const random = ref('')
// ()
const layerPosition = reactive({
left: 0,
@ -108,6 +106,8 @@ const largePosition = reactive({
})
const cropper = ref(null)
const { elementX, elementY } = useMouseInElement(cropper)
//
const transform = ref({})
/** 编辑头像 */
function editCropper() {
@ -168,19 +168,16 @@ function uploadImg() {
/** 实时预览 */
function realTime(data) {
options.previews = data
random.value = getRandomValue()
}
//
const getRandomValue = () => {
return Math.random()
transform.value = Object.assign({}, data.img)
}
/** 关闭窗口 */
function closeDialog() {
options.img = userStore.avatar
console.log(userStore.avatar,'userStore.avatar')
options.visible = false
}
watch(random, () => {
watch(transform, () => {
//
show.value = true
//