文档 https://doc.dcloud.net.cn/uni-app-x/component/camera.html)
大佬们, 我是菜B, 刚学这个没多久, 有个需求是自定义摄像头, 之前是uniapp nvue 用live-pusher实现的, 但是质量太低了
看到文档 uniapp-x 有camera组件, 看实例demo没问题, 但是真机运行的时候提示 amera组件不存在
请问是不是需要额外配置什么, 标准基座, 重新打包了自定义基座, 都是提示这个
麻烦大家了, 真的搞不懂
23:22:48.582 正在同步手机端程序文件...
23:22:48.626 同步手机端程序文件完成
23:22:49.638 正在启动自定义基座...
23:22:49.819 App Launch at App.uvue:5
23:22:49.820 camera组件不存在,请确保组件代码正确或重新制作自定义基座。
23:22:49.820 App Show at App.uvue:8
23:22:49.909 应用启动到触发onLaunch耗时: 1892ms
23:22:49.909 进入页面:/pages/index/index 。[{"创建dom元素个数":"2个","耗时":"9ms"},{"排版":"1次","耗时":"1ms"},{"渲染":"1次","耗时":"4ms"},{"跳转页面到onReady总耗时":"98ms"}]
实际开发的时候
<template>
<view style="flex: 1;">
<camera style="width: 100%; height: 300px;"></camera>
</view>
</template>
<script>
export default {
data() {
return {
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.uni-title {
padding: 10px 0;
}
.uni-title-text {
font-size: 15px;
font-weight: bold;
}
.uni-camera-wrapper {
display: flex;
padding: 8px 13px;
margin: 5px 0;
flex-direction: row;
flex-wrap: nowrap;
background-color: #ffffff;
}
.uni-camera-test-host {
height: 28px;
padding: 0px;
flex: 1;
background-color: #ffffff;
}
.uni-camera-test-host-without-flex {
height: 28px;
padding: 0px;
background-color: #ffffff;
}
.uni-title-size {
font-size: 22px;
}
</style>
1 个回复
三自 (作者) - 清风望月
版本问题, 我的问题 , 更新到最新的编辑器, 就可以展示摄像头了
这个怎么关闭呀
2025-04-30 17:02 s***@dcloud.io 设置了状态: 【BUG:已发版】 改为 【BUG:已发版】 ,版本号:4.64.2025042916