重复
重复
  • 发布:2019-10-09 23:17
  • 更新:2019-10-10 22:09
  • 阅读:1155

#插件讨论# 【 图片裁剪 - 因吹丝挺 】小程序编译出错

分类:uni-app

<template>  
    <view>  
        <image-cropper :src="imgurl" @confirm="doUpload" @cancel="cancel"></image-cropper>  
    </view>  
</template>  

<script>  
    import { mapState, mapMutations } from 'vuex'  
    import ImageCropper from "@/components/invinbg-image-cropper/invinbg-image-cropper.vue"  
    export default {  
        components: {ImageCropper},  
        data() {  
            return {  
                imgurl: ''  
            }  
        },  
        computed: {  
            ...mapState(['userAvatar'])  
        },  
        onLoad() {  
            let vm = this;  
            uni.chooseImage({  
                count: 1, //默认9  
                sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有  
                sourceType: ['album'], //从相册选择  
                success: (res) => {  
                    vm.imgurl = res.tempFilePaths[0];  
                    console.log(res, vm.imgurl);  
                },  
                fail: (err) => {  
                    uni.navigateBack()  
                }  
            })  
        },  
        methods: {  
            ...mapMutations(['updateAvatar']),  
            doUpload(e) {  
                this.updateAvatar(e.detail.tempFilePath);  
                uni.navigateBack();  
            },  
            cancel() {  
                uni.navigateBack()  
            }  
        }  
    }  
</script>  

<style>  
</style>  
2019-10-09 23:17 负责人:无 分享
已邀请:
因吹丝挺

因吹丝挺

你的HbuilderX 版本号是多少,我这边没问题

重复

重复 (作者)

2.2.2.X

  • 因吹丝挺

    那应该没问题的啊,把你的完整的错误信息复制上来我看看,不要截图

    2019-10-10 13:53

  • 叶凌风

    回复 因吹丝挺: 小程序也不能获取base64地址,发生VM1410:1 Failed to load local image resource /components/invinbg-image-cropper/

    the server responded with a status of 500 (HTTP/1.1 500 Internal Server Error)

    2020-02-17 01:44

重复

重复 (作者)

更新了IDE到2.3.3版,基本正常了,只是单位好像仍有问题

该问题目前已经被锁定, 无法添加新回复