Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
V2 cropperjs with Vue doesn't allow image to take full height #954

I'm trying to use cropperjs v2 within my Vue app, but I can't find the option and way for cropper to take full width and height of the image that is being cropped.

Can you help me and point me to the resources where I can find how to make basically something like this: https://agontuk.github.io/vue-cropperjs/

Here is my code:

<template>
    <div>
        <img ref="cropperImage" :src="imageUrl" alt="Cropper Image." class="block max-w-full" />
    </div>
</template>

<script lang="ts">
import Cropper from 'cropperjs';
import { Component, Prop, Ref, Vue } from 'vue-property-decorator';

@Component
export default class ImageCropper extends Vue {
    @Prop({ type: String, required: true }) readonly imageUrl!: string;
    @Ref() readonly cropperImage!: HTMLImageElement;

    cropper: Cropper | undefined;

    mounted() {
        this.cropper = new Cropper(this.cropperImage);
    }
}
</script>

And it produces this:

image

For this image:

https://i.picsum.photos/id/586/1600/900.jpg?hmac=rEPQN9kLTvjDkNQEqYhLukHWcJlKUtTGl-u2hmgXIkc

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda