8***@qq.com
8***@qq.com
  • 发布:2024-01-09 20:40
  • 更新:2024-10-12 14:55
  • 阅读:437

uni.chooseMedia报错

分类:uni-app
<template>  
    <view>  
        <button @click="chooseMig">选择图片</button>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  

            }  
        },  
        onLoad() {  

        },  
        methods: {  
            chooseMig :function(){  
                uni.chooseMedia({  
                  count: 3,  
                  mediaType: ['image','video'],  
                  sourceType: ['album', 'camera'],  
                  maxDuration: 30,  
                  camera: 'back',  
                  success(res) {  
                    console.log(res.tempFiles)  
                  }  
                });  
            }  
        }  
    }  
</script>  

<style>  

</style>  

点击按钮后,报错,提示:
https://github.com/vuejs/vue-devtools
chunk-vendors.js:2765 [Vue warn]: Error in v-on handler: "TypeError: uni.chooseMedia is not a function"

found in

---> at pages/index/index.vue

  • 请问这是怎么回事呀?
2024-01-09 20:40 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com (作者)

谢谢

4***@qq.com

4***@qq.com

运行到手机或模拟器,Android基座,调试,也报 uni.chooseMedia is not a function 怎么回事啊

要回复问题请先登录注册