This commit is contained in:
2025-12-27 03:16:11 +08:00
parent 8022c596f9
commit e63f144ac4
2 changed files with 13 additions and 9 deletions
@@ -7,6 +7,7 @@ import { onMounted, ref } from "vue";
import Cropper from 'cropperjs';
const image = new Image();
image.src = "https://wnfed.com/usr/uploads/2020/07/736937178.jpg";
image.alt = 'Picture';
@@ -20,8 +21,7 @@ onMounted(()=>{
cropper.value = new Cropper(image, {
container: imagecroppert.value,
aspectRatio: 1,
viewMode: 2,
});
@@ -33,12 +33,23 @@ onMounted(()=>{
})
function getsele(){
console.log(cropper.value.getCropperCanvas())
}
</script>
<template>
<div class="cropper-container" ref="imagecroppert"></div>
<button @click="getsele">getsele</button>
</template>
<style lang="scss" scoped>