網站首頁 編程語言 正文
代碼示例:
<template>
<view>
<camera device-position="back" flash="off" @error="error" style="width: 100%; height: 300px;"></camera>
<button type="primary" @click="takePhoto">拍照</button>
<view>預覽</view>
<image mode="widthFix" :src="src"></image>
</view>
</template>
export default {
data() {
return {
src:""
}
},
methods: {
takePhoto() {
const ctx = uni.createCameraContext();
ctx.takePhoto({
quality: 'high',
success: (res) => {
this.src = res.tempImagePath
}
});
},
error(e) {
console.log(e.detail);
}
}
}
原文鏈接:https://blog.csdn.net/maoge_666/article/details/131081194
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2023-11-26 (有效解決)Android Studio 運行項目時報 Package install error:
- 2022-06-16 Python數據結構之遞歸方法詳解_python
- 2022-07-12 git同步fork倉庫同步upstream倉庫
- 2022-06-02 解決Spring Boot數據庫多數據源配置報jdbcUrl is required with dr
- 2023-01-01 C語言用fun函數實現兩個數的交換方式_C 語言
- 2022-07-17 關于python通過新建環境安裝tfx的問題_python
- 2022-08-12 Python?Pandas?中的數據結構詳解_python
- 2023-10-17 uniapp通過功能性編碼跳轉到原生的app頁面
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支