<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
- 请问这是怎么回事呀?
3 个回复
DCloud_UNI_Anne
注意 平台差异说明
8***@qq.com (作者)
谢谢
4***@qq.com
运行到手机或模拟器,Android基座,调试,也报 uni.chooseMedia is not a function 怎么回事啊
x***@foxmail.com
注意 平台差异说明
2024-10-12 16:17