首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

OpenHarmonyHarmonyOS震动模块的使用

@ohos.vibrator (振动) 作者:坚果,公众号:”大前端之旅“,哔哩哔哩,OpenHarmony布道师,OpenHarmony校源行开源大使,51CTO博客专家博主,阿里云博客专家。...导入模块 使用的时候,需要先导入对应的模块 import vibrator from '@ohos.vibrator'; 添加权限 然后需要添加权限 FA "reqPermissions": [...示例: import vibrator from '@ohos.vibrator'; @Entry @Component struct VibPage { @State message: string...this.message) .fontSize(50) .fontWeight(FontWeight.Bold).onClick(()=>{ vibrator.vibrate...} } 需要注意的是在HarmonyOS应用中,ApI8的 接口声明文件编写错误,需要手动修改下SDK目录下接口声明文件,文件路径Sdk\openharmony\8\ets\api@ohos.vibrator.d.ts

51920
领券