Replies: 1 comment 1 reply
-
已经一周了 闲着没事的我 又照着文档实例试了一遍 还是不行。 好吧 我要放弃了 浪费的时间太多了 <template>
<div class="cropper-container"></div>
</template>
<script lang="ts">
import Cropper from 'cropperjs'
export default {
name: 'CropperExample',
data() {
return {
src: `https://images.unsplash.com/photo-1619737307100-55b82496fcda?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80`
}
},
mounted() {
const image = new Image()
image.src = this.src
image.alt = 'Picture'
const cropper = new Cropper(image, {
container: '.cropper-container'
})
// eslint-disable-next-line no-console
console.log(cropper)
}
}
</script>
<style lang="scss">
.cropper-container {
border: 1px solid var(--vp-c-divider);
border-radius: 0.375rem;
margin-bottom: 1rem;
margin-top: 1rem;
padding: 1.25rem 1.5rem;
cropper-canvas {
height: 360px;
}
}
</style>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
我不知道这是什么原因, 困扰了我好几个小时了。感觉像是样式没有加载?
Beta Was this translation helpful? Give feedback.
All reactions