2019-02-07 19:05:59 +11:00
|
|
|
<template>
|
|
|
|
<div class="image-cropper">
|
2019-02-09 03:42:02 +11:00
|
|
|
<modal :show="dataUrl" :title="modalTitle" @close="destroy">
|
2019-02-07 19:05:59 +11:00
|
|
|
<div class="modal-body">
|
|
|
|
<div class="image-cropper-image-container">
|
|
|
|
<img ref="img" :src="dataUrl" alt="" @load.stop="createCropper" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2019-02-09 03:42:02 +11:00
|
|
|
<button class="btn image-cropper-btn" type="button" @click="submit" v-text="modalSaveButtonLabel"></button>
|
2019-02-07 19:05:59 +11:00
|
|
|
</div>
|
|
|
|
</modal>
|
|
|
|
<input ref="input" type="file" class="image-cropper-img-input" :accept="mimes">
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./image_cropper.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.image-cropper {
|
|
|
|
&-img-input {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-image-container {
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
img {
|
|
|
|
display: block;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-btn {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|