advanced-cropper / vue-advanced-cropper

The advanced vue cropper library that gives you opportunity to create your own croppers suited for any website design
https://advanced-cropper.github.io/vue-advanced-cropper/
Other
931 stars 130 forks source link

How to implement cropper responsiveness? #224

Closed Brunnn closed 1 year ago

Brunnn commented 1 year ago

It's not clear to me, and neither i found something objetive in the docs talking about how responsiviness is/can be implemented using the cropper. I used in some pages using flex boxes and it's just not resizing with the window. So, how should it be done? My code looks like this:

<template>
<div class="croppable-image-field">
        <Cropper
            ref="cropperRef"
            class="cropper"
            :src="image64"
            :stencil-component="stencilComponent"
            :stencil-props="{
                aspectRatio: aspectRatio
            }"
            @change="onCrop"
        ></Cropper>
</div>
</template>
<style lang="scss">

.croppable-image-field {
    display: flex;
    flex-flow: column nowrap;

    max-width: 100%;

    .cropper {
        flex: 1;
        width: 100%;
        margin-bottom: 10px;
    }
}
</style>
Norserium commented 1 year ago

@Brunnn, could you provide the sandbox with the minimal reproducible example?