金满斗
金满斗
  • 发布:2025-09-22 18:59
  • 更新:2025-09-23 20:25
  • 阅读:9

uni.chooseImage在鸿蒙19虚拟机上点击无反应也没明显报错

分类:鸿蒙Next

见我录的视频
!

<template>  
    <view class="content">  
        <image class="logo" src="/static/logo.png"></image>  
        <view class="text-area">  
            <text class="title">{{title}}</text>  
        </view>  
        <view   style="padding:40upx;text-align: center;   background-color: black;color: aliceblue;margin: 100upx;width: 200upx;"  @tap="upload">传图</view>    
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                title: 'Hello'  
            }  
        },  
        onLoad() {  

        },  
        methods: {  
            upload(){  
                uni.chooseImage({  
                  count: 3,   
                  sizeType: ['compressed'],   
                  sourceType: ['album'],   
                  success: (res) => console.log('结果:', res),  
                  fail: (err) => console.error('失败原因:', err)   
                });  
            }  
        }  
    }  
</script>  

<style>  
    .content {  
        display: flex;  
        flex-direction: column;  
        align-items: center;  
        justify-content: center;  
    }  

    .logo {  
        height: 200rpx;  
        width: 200rpx;  
        margin-top: 200rpx;  
        margin-left: auto;  
        margin-right: auto;  
        margin-bottom: 50rpx;  
    }  

    .text-area {  
        display: flex;  
        justify-content: center;  
    }  

    .title {  
        font-size: 36rpx;  
        color: #8f8f94;  
    }  
</style>  

简单的示例代码,你们都没遇到吗?

2025-09-22 18:59 负责人:无 分享
已邀请:
金满斗

金满斗 (作者) - 聚宝盆记账易,真的好用

!问题示例视频

金满斗

金满斗 (作者) - 聚宝盆记账易,真的好用

https://uniapp.dcloud.net.cn/component/map.html 视频地址

金满斗

金满斗 (作者) - 聚宝盆记账易,真的好用

找到原因了,还是要申请对应的权限才行

金满斗

金满斗 (作者) - 聚宝盆记账易,真的好用

还有就是新开的虚拟机,一定要开打开图库使用了才行,不打开图库就打不开。

要回复问题请先登录注册