Closed jaredmeakin closed 1 year ago
So, I have an <input /> that I'm trying to upload a photo to. I want to pass that file to the <cropper /> component, but that doesn't seem to work. Is there a way to accomplish what I'm trying to do?
<input />
<cropper />
<app-input v-model="photo" class="mb-5" name="photo" type="file" accept="image/png, image/jpeg" placeholder="Upload a photo" @change="onPhotoUpload" /> <cropper class="cropper" :src="photo" :stencil-props="{ aspectRatio: 10 / 12 }" />
const photo = ref(); function onPhotoUpload(e) { photo.value = e.target.value; }
@jaredmeakin, did you try the approach from the "load image from a disc" guide?
Thanks that should work!
So, I have an
<input />
that I'm trying to upload a photo to. I want to pass that file to the<cropper />
component, but that doesn't seem to work. Is there a way to accomplish what I'm trying to do?