当前位置:网站首页>第四次培训
第四次培训
2022-08-03 05:10:00 【曲水流觞683】
本次开发主要讲述的是拍照功能的实现
主要利用了:
camera组件
以下为相关示例:
<!-- xxx.hml-->
<div class="container">
<camera flash="on" deviceposition="back" @error="cameraError">
</camera>
</div>
/* xxx.css */
.container {
display: flex;
justify-content: center;
align-items: center;
}
camera{
width: 300px;
height: 300px;
}
//xxx.js
import prompt from '@system.prompt';
export default {
data: {
title: 'World'
},
cameraError(){
prompt.showToast({
message: "授权失败!"
});
}
}
web组件
首先要添加权限列表:ohos.permission.INTERNET
一个页面只支持一个web组件,会全屏显示,若页面中还有其他组件,会被web组件覆盖,web组件不跟随转场动画


边栏推荐
- closures in js
- ss-5.consul服务端+生产者+消费者
- Where is the value of testers
- MCM box model modeling method and source analysis of atmospheric O3
- Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures
- 在树莓派上搭建属于自己的网页(2)
- How to prepare for the test interface test data
- Lambda表达式案例
- breed Web刷机升级详细教材修正编译器固件说明_itkeji.top
- Installation of Apache DolphinScheduler version 2.0.5 distributed cluster
猜你喜欢

js实现一个 bind 函数

Installation of Apache DolphinScheduler version 2.0.5 distributed cluster

FileZilla 搭建ftp服务器

【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed

【 Harmony OS 】 【 ano UI 】 lightweight data storage

Interface test practice | Detailed explanation of the difference between GET / POST requests

typescript42-readonly修饰符

内部类、static关键字、final

Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG

2. 两数相加
随机推荐
ss-4.2 多个eureka集群案例
接口测试如何准备测试数据
Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data
shell script loop statement
CAD有生僻字如何打出来、如何提交软件相关问题或建议?
tag单调栈-单调栈预备知识-lt.739. 每日温度
Create a tree structure
Exception (abnormal) and Error (error) difference analysis
Fluorescent marker peptides FITC/AMC/FAM/Rhodamine TAMRA/Cy3 / Cy5 / Cy7 - Peptide
MOSN 反向通道详解
typescript40-class类的保护修饰符
Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8
探索性测试的概念及方法
Build your own web page on raspberry pie (1)
建立树形结构
在树莓派上搭建属于自己的网页(2)
安装IIS服务(Internet信息服务(Internet Information Services,简写IIS,互联网信息服务)
js garbage collection mechanism
idea使用@Autowired注解爆红原因及解决方法
[Fine talk] Using native js to implement todolist