Skip to content
On this page

[DEPRECATED] vscode-uni-app-snippets

该插件已废弃,请迁移到功能一致的 uni-helper.uni-app-snippets-vscode

License

VSCode

OpenVSX

改动日志

插件特性

插件和文档的冲突之处,请以文档为准。

插件源代码在 ModyQyW/uni-helper。欢迎提交 ISSUE 和 PR 改进本插件。

使用

安装插件后重启 VSCode 即可。

HTML

APIPrefixDescription
APP-PLUSplatform-app, app, platform-app-plus, app-plusuni-app APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
APP-NVUEplatform-app-nvue, app-nvue, platform-app-plus-nvue, app-plus-nvueuni-app APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
H5platform-h5, h5uni-app H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MPplatform-mp, mp, platform-miniprogram, miniprogramuni-app 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-WEIXINplatform-mp-weixin, mp-weixin, platform-weixin, weixin, platform-mp-wechat, mp-wechat, platform-wechat, wechatuni-app 微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-ALIPAYplatform-mp-alipay, mp-alipay, platform-alipay, alipay, platform-mp-ali, mp-ali, platform-ali, ali, platform-mp-my, mp-my, platform-my, myuni-app 支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-BAIDUplatform-mp-baidu, mp-baidu, platform-baidu, baidu, platform-mp-swan, mp-swan, platform-swan, swanuni-app 百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-TOUTIAOplatform-mp-toutiao, mp-toutiao, platform-toutiao, toutiao, platform-mp-bytedance, mp-bytedance, platform-bytedance, bytedanceuni-app 字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-LARKplatform-mp-lark, mp-lark, platform-lark, larkuni-app 飞书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-QQplatform-mp-qq, mp-qq, platform-qq, qquni-app QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-KUAISHOUplatform-mp-kuaishou, mp-kuaishou, platform-kuaishou, kuaishouuni-app 快手小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-JDplatform-mp-jd, mp-jd, platform-jd, jduni-app 京东小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-360platform-mp-360, mp-360, platform-360, 360uni-app 360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-XHSplatform-mp-xhs, mp-xhs, platform-xhs, xhsuni-app 小红书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEWplatform-quickapp, quickapp, platform-quickapp-webview, quickapp-webviewuni-app 快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-UNIONplatform-quickapp-union, quickapp-union, platform-quickapp-webview-union, quickapp-webview-unionuni-app 快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-HUAWEIplatform-quickapp-huawei, quickapp-huawei, platform-quickapp-webview-huawei, quickapp-webview-huaweiuni-app 快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
<!-- #ifdef -->#ifdef, ifdefuni-app 条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
<!-- #ifndef -->#ifndef, ifndefuni-app 条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
<!-- #endif -->#endif, endifuni-app 结束条件编译。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
<view>view, <view>uni-app 视图容器,用于包裹各种元素内容。更多信息查看 https://uniapp.dcloud.io/component/view
<scroll-view>scroll-view, <scroll-view>uni-app 可滚动视图区域。竖向滚动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/scroll-view
<swiper>swiper, <swiper>uni-app 滑块视图容器。子组件只能是 swiper-item。竖向滑动时,需要给一个固定高度。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper
<swiper-item>swiper-item, <swiper-item>uni-app swiper 的子组件,宽高自动设置为 100%。更多信息查看 https://uniapp.dcloud.io/component/swiper?id=swiper-item
<match-media>match-media, <match-media>uni-app 可适配不同屏幕的基本视图组件。更多信息查看 https://uniapp.dcloud.io/component/match-media
<movable-area>movable-area, <movable-area>uni-app 可拖动区域组件,指代可拖动的范围。子组件只能是 movable-view。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-area
<movable-view>movable-view, <movable-view>uni-app 可移动的视图容器。只能是 movable-area 的子组件。更多信息查看 https://uniapp.dcloud.io/component/movable-view?id=movable-view
<cover-view>cover-view, <cover-view>uni-app 覆盖在原生组件上的文本视图。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-view
<cover-image>cover-image, <cover-image>uni-app 覆盖在原生组件上的图片视图。可以嵌套在 cover-view 里。更多信息查看 https://uniapp.dcloud.io/component/cover-view?id=cover-image
<icon>icon, <icon>uni-app 图标。更多信息查看 https://uniapp.dcloud.io/component/icon
<text>text, <text>uni-app 文本组件。用于包裹文本内容。更多信息查看 https://uniapp.dcloud.io/component/text
<rich-text>rich-text, <rich-text>uni-app 富文本。更多信息查看 https://uniapp.dcloud.io/component/rich-text
<progress>progress, <progress>uni-app 进度条。更多信息查看 https://uniapp.dcloud.io/component/progress
<button>button, <button>uni-app 按钮。更多信息查看 https://uniapp.dcloud.io/component/button
<checkbox-group>checkbox-group, <checkbox-group>uni-app 多选框组。更多信息查看 https://uniapp.dcloud.io/component/checkbox?id=checkbox-group
<checkbox>checkbox, <checkbox>uni-app 多选框。更多信息查看 https://uniapp.dcloud.io/component/checkbox?id=checkbox
<editor>editor, <editor>uni-app 富文本编辑器,可以对图片、文字格式进行编辑和混排。更多信息查看 https://uniapp.dcloud.io/component/editor
<form>form, <form>uni-app 表单,将组件内的用户输入的 switch input checkbox slider radio picker 提交。更多信息查看 https://uniapp.dcloud.io/component/form
<input>input, <input>uni-app 输入框。更多信息查看 https://uniapp.dcloud.io/component/input
<label>label, <label>uni-app 用来改进表单组件的可用性。更多信息查看 https://uniapp.dcloud.io/component/label
<picker>picker-selector, <picker-selector>uni-app 单列选择器。更多信息查看 https://uniapp.dcloud.io/component/picker?id=普通选择器
<picker>picker-multi, picker-multi-selector, <picker-multi>, <picker-multi-selector>uni-app 多列选择器。更多信息查看 https://uniapp.dcloud.io/component/picker?id=多列选择器
<picker>picker-time, <picker-time>uni-app 时间选择器。更多信息查看 https://uniapp.dcloud.io/component/picker?id=时间选择器
<picker>picker-date, <picker-date>uni-app 日期选择器。更多信息查看 https://uniapp.dcloud.io/component/picker?id=日期选择器
<picker>picker-region, <picker-region>uni-app 区域选择器。更多信息查看 https://uniapp.dcloud.io/component/picker?id=省市区选择器
<picker-view>picker-view, <picker-view>uni-app 比 picker 更灵活的嵌入页面的滚动选择器。子组件只能是 picker-view-column。更多信息查看 https://uniapp.dcloud.io/component/picker-view?id=picker-view
<picker-view-column>picker-view-column, <picker-view-column>uni-app picker-view 的子组件。更多信息查看 https://uniapp.dcloud.io/component/picker-view?id=picker-view-column
<radio-group>radio-group, <radio-group>uni-app 单选框组。更多信息查看 https://uniapp.dcloud.io/component/radio?id=radio-group
<radio>radio, <radio>uni-app 单选框。更多信息查看 https://uniapp.dcloud.io/component/radio?id=radio
<slider>slider, <slider>uni-app 滑动选择器。更多信息查看 https://uniapp.dcloud.io/component/slider
<switch>switch, <switch>uni-app 开关选择器。更多信息查看 https://uniapp.dcloud.io/component/switch
<textarea>textarea, <textarea>uni-app 多行输入框。更多信息查看 https://uniapp.dcloud.io/component/textarea
<navigator>navigator, <navigator>uni-app 页面跳转组件。只能跳转本地页面。目标页面必须已注册。更多信息查看 https://uniapp.dcloud.io/component/navigator
<audio>audio, <audio>uni-app 音频组件。请考虑使用 uni.createInnerAudioContext 代替。更多信息查看 https://uniapp.dcloud.io/component/audio
<camera>camera, <camera>uni-app 页面内嵌的区域相机组件。请考虑使用 uni.chooseImage 或 uni.chooseVideo 代替。更多信息查看 https://uniapp.dcloud.io/component/camera
<image>image, <image>uni-app 图片组件。更多信息查看 https://uniapp.dcloud.io/component/image
<video>video, <video>uni-app 视频组件。更多信息查看 https://uniapp.dcloud.io/component/video
<live-player>live-player, <live-player>uni-app 直播拉流组件。更多信息查看 https://uniapp.dcloud.io/component/live-player
<live-pusher>live-pusher, <live-pusher>uni-app 直播推流组件。更多信息查看 https://uniapp.dcloud.io/component/live-pusher
<map>map, <map>uni-app 地图组件。更多信息查看 https://uniapp.dcloud.io/component/map
<canvas>canvas, <canvas>uni-app 画布组件。更多信息查看 https://uniapp.dcloud.io/component/canvas
<web-view>web-view, <web-view>uni-app 浏览器组件,自动铺满整个页面。更多信息查看 https://uniapp.dcloud.io/component/web-view
<ad>ad, <ad>uni-app 应用内展示的广告组件。更多信息查看 https://uniapp.dcloud.io/component/ad
<ad-draw>ad-draw, <ad-draw>uni-app 【APP-NVUE 专用】应用内竖屏沉浸视频流广告。更多信息查看 https://uniapp.dcloud.io/component/ad-draw
<ad-content-page>ad-content-page, <ad-content-page>uni-app 【ANDROID-NVUE 专用】应用内短视频内容联盟组件。更多信息查看 https://uniapp.dcloud.io/component/ad-content-page
<page-meta>page-meta, <page-meta>uni-app 页面属性配置节点,用于指定页面的一些属性、监听页面事件。只能是页面内第一个组件。更多信息查看 https://uniapp.dcloud.io/component/page-meta
<navigation-bar>navigation-bar, <navigation-bar>uni-app 页面导航条配置节点,用于指定导航栏的一些属性。只能是 page-meta 组件第一个子组件。更多信息查看 https://uniapp.dcloud.io/component/navigation-bar
<custom-tab-bar>custom-tab-bar, <custom-tab-bar>uni-app 【H5 专用】自定义 TabBar 组件。更多信息查看 https://uniapp.dcloud.io/component/custom-tab-bar
<open-data>open-data, <open-data>uni-app 用于展示平台开放的数据。更多信息查看 https://uniapp.dcloud.io/component/open-data
<barcode>barcode, <barcode>uni-app 【APP-NVUE 专用】扫码组件。更多信息查看 https://uniapp.dcloud.io/component/barcode
<list>list, <list>uni-app 【APP-NVUE 专用】列表组件。更多信息查看 https://uniapp.dcloud.io/component/list
<cell>cell, <cell>uni-app 【APP-NVUE 专用】列表项组件。更多信息查看 https://uniapp.dcloud.io/component/cell
<recycle-list>recycle-list, <recycle-list>uni-app 【APP-NVUE 专用】列表组件。更多信息查看 https://uniapp.dcloud.io/component/recycle-list
<cell-slot>cell, <cell>uni-app 【APP-NVUE 专用】列表项组件。更多信息查看 https://uniapp.dcloud.io/component/recycle-list
<waterfall>waterfall, <waterfall>uni-app 【APP-NVUE 专用】瀑布流组件。更多信息查看 https://uniapp.dcloud.io/component/waterfall
<refresh>refresh, <refresh>uni-app 【APP-NVUE 专用】列表下拉刷新组件。更多信息查看 https://uniapp.dcloud.io/component/refresh

CSS/LESS/SCSS/SASS/STYLUS

APIPrefixDescription
APP-PLUSplatform-app, app, platform-app-plus, app-plusuni-app APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
APP-NVUEplatform-app-nvue, app-nvue, platform-app-plus-nvue, app-plus-nvueuni-app APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
H5platform-h5, h5uni-app H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MPplatform-mp, mp, platform-miniprogram, miniprogramuni-app 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-WEIXINplatform-mp-weixin, mp-weixin, platform-weixin, weixin, platform-mp-wechat, mp-wechat, platform-wechat, wechatuni-app 微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-ALIPAYplatform-mp-alipay, mp-alipay, platform-alipay, alipay, platform-mp-ali, mp-ali, platform-ali, ali, platform-mp-my, mp-my, platform-my, myuni-app 支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-BAIDUplatform-mp-baidu, mp-baidu, platform-baidu, baidu, platform-mp-swan, mp-swan, platform-swan, swanuni-app 百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-TOUTIAOplatform-mp-toutiao, mp-toutiao, platform-toutiao, toutiao, platform-mp-bytedance, mp-bytedance, platform-bytedance, bytedanceuni-app 字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-LARKplatform-mp-lark, mp-lark, platform-lark, larkuni-app 飞书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-QQplatform-mp-qq, mp-qq, platform-qq, qquni-app QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-KUAISHOUplatform-mp-kuaishou, mp-kuaishou, platform-kuaishou, kuaishouuni-app 快手小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-JDplatform-mp-jd, mp-jd, platform-jd, jduni-app 京东小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-360platform-mp-360, mp-360, platform-360, 360uni-app 360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-XHSplatform-mp-xhs, mp-xhs, platform-xhs, xhsuni-app 小红书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEWplatform-quickapp, quickapp, platform-quickapp-webview, quickapp-webviewuni-app 快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-UNIONplatform-quickapp-union, quickapp-union, platform-quickapp-webview-union, quickapp-webview-unionuni-app 快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-HUAWEIplatform-quickapp-huawei, quickapp-huawei, platform-quickapp-webview-huawei, quickapp-webview-huaweiuni-app 快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
/* #ifdef */#ifdef, ifdefuni-app 条件编译,处理某平台。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
/* #ifndef */#ifndef, ifndefuni-app 条件编译,排除某平台。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
/* #endif */#endif, endifuni-app 结束条件编译。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
var(--status-bar-height)--status-bar-height, var(--status-bar-height)uni-app 系统状态栏高度变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css变量
var(--window-top)--window-top, var(--window-top)uni-app 内容区域距离顶部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css变量
var(--window-bottom)--window-bottom, var(--window-bottom)uni-app 内容区域距离底部的距离变量。更多信息查看 https://uniapp.dcloud.io/frame?id=css变量

JavaScript/TypeScript

APIPrefixDescription
APP-PLUSplatform-app, app, platform-app-plus, app-plusuni-app APP 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
APP-NVUEplatform-app-nvue, app-nvue, platform-app-plus-nvue, app-plus-nvueuni-app APP-NVUE 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
H5platform-h5, h5uni-app H5 对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MPplatform-mp, mp, platform-miniprogram, miniprogramuni-app 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-WEIXINplatform-mp-weixin, mp-weixin, platform-weixin, weixin, platform-mp-wechat, mp-wechat, platform-wechat, wechatuni-app 微信小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-ALIPAYplatform-mp-alipay, mp-alipay, platform-alipay, alipay, platform-mp-ali, mp-ali, platform-ali, ali, platform-mp-my, mp-my, platform-my, myuni-app 支付宝小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-BAIDUplatform-mp-baidu, mp-baidu, platform-baidu, baidu, platform-mp-swan, mp-swan, platform-swan, swanuni-app 百度小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-TOUTIAOplatform-mp-toutiao, mp-toutiao, platform-toutiao, toutiao, platform-mp-bytedance, mp-bytedance, platform-bytedance, bytedanceuni-app 字节跳动小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-LARKplatform-mp-lark, mp-lark, platform-lark, larkuni-app 飞书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-QQplatform-mp-qq, mp-qq, platform-qq, qquni-app QQ 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-KUAISHOUplatform-mp-kuaishou, mp-kuaishou, platform-kuaishou, kuaishouuni-app 快手小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-JDplatform-mp-jd, mp-jd, platform-jd, jduni-app 京东小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-360platform-mp-360, mp-360, platform-360, 360uni-app 360 小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
MP-XHSplatform-mp-xhs, mp-xhs, platform-xhs, xhsuni-app 小红书小程序对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEWplatform-quickapp, quickapp, platform-quickapp-webview, quickapp-webviewuni-app 快应用通用对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-UNIONplatform-quickapp-union, quickapp-union, platform-quickapp-webview-union, quickapp-webview-unionuni-app 快应用联盟对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
QUICKAPP-WEBVIEW-HUAWEIplatform-quickapp-huawei, quickapp-huawei, platform-quickapp-webview-huawei, quickapp-webview-huaweiuni-app 快应用华为对应的 %PLATFORM 值。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
`// #ifdef ${1APP-PLUS,APP-NVUE,H5,MP,MP-WEIXIN,MP-ALIPAY,MP-BAIDU,MP-TOUTIAO,MP-LARK,MP-QQ,MP-KUAISHOU,MP-360,QUICKAPP-WEBVIEW,QUICKAPP-WEBVIEW-UNION,QUICKAPP-WEBVIEW-HUAWEI}`
`// #ifndef ${1APP-PLUS,APP-NVUE,H5,MP,MP-WEIXIN,MP-ALIPAY,MP-BAIDU,MP-TOUTIAO,MP-LARK,MP-QQ,MP-KUAISHOU,MP-360,QUICKAPP-WEBVIEW,QUICKAPP-WEBVIEW-UNION,QUICKAPP-WEBVIEW-HUAWEI}`
// #endif#endif, endifuni-app 结束条件编译。更多信息查看 https://uniapp.dcloud.io/tutorial/platform.html
process.env.NODE_ENV === 'development'process.env.NODE_ENV === 'development'uni-app 判断是否为开发环境。更多信息查看 https://cli.vuejs.org/zh/guide/mode-and-env.html
process.env.NODE_ENV !== 'development'process.env.NODE_ENV !== 'development'uni-app 判断是否不为开发环境。更多信息查看 https://cli.vuejs.org/zh/guide/mode-and-env.html
process.env.NODE_ENV === 'production'process.env.NODE_ENV === 'production'uni-app 判断是否为生产环境。更多信息查看 https://cli.vuejs.org/zh/guide/mode-and-env.html
process.env.NODE_ENV !== 'production'process.env.NODE_ENV !== 'production'uni-app 判断是否不为生产环境。更多信息查看 https://cli.vuejs.org/zh/guide/mode-and-env.html
uni.base64ToArrayBuffer()uni.base64ToArrayBufferuni-app 将 base64 字符串转成 ArrayBuffer。更多信息查看 https://uniapp.dcloud.io/api/base64ToArrayBuffer
uni.arrayBufferToBase64()uni.arrayBufferToBase64uni-app 将 ArrayBuffer 字符串转成 base64。更多信息查看 https://uniapp.dcloud.io/api/arrayBufferToBase64
onLaunch()onLaunchuni-app 应用生命周期,只能在 App.vue 中监听。uni-app 初始化完成时触发,全局只触发一次。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onShow()onShowuni-app 应用生命周期,只能在 App.vue 中监听。uni-app 启动时或从后台进入前台时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onHide()onHideuni-app 应用生命周期,只能在 App.vue 中监听。uni-app 从前台进入后台时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onError()onErroruni-app 应用生命周期,只能在 App.vue 中监听。uni-app 报错时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onUniNViewMessage()onUniNViewMessageuni-app 应用生命周期,只能在 App.vue 中监听。监听 nvue 页面发送的数据。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onUnhandledRejection()onUnhandledRejectionuni-app 应用生命周期,只能在 App.vue 中监听。监听未处理的 Promise 拒绝事件。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onPageNotFound()onPageNotFounduni-app 应用生命周期,只能在 App.vue 中监听。uni-app 页面不存在时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onThemeChange()onThemeChangeuni-app 应用生命周期,只能在 App.vue 中监听。系统主题变化时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=应用生命周期
onInit()onInituni-app 页面生命周期。页面加载时触发,参数是上个页面传递的数据,类型是 object。触发时机早于 onLoad。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onLoad()onLoaduni-app 页面生命周期。页面加载时触发,参数是上个页面传递的数据,类型是 object。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onShow()onShowuni-app 页面生命周期。页面在屏幕上显示时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onReady()onReadyuni-app 页面生命周期。页面初次渲染完成时触发,如果渲染速度快,会在页面进入动画完成前触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onHide()onHideuni-app 页面生命周期。页面在屏幕上隐藏时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onUnload()onUnloaduni-app 页面生命周期。页面卸载时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onResize()onResizeuni-app 页面生命周期。窗口尺寸变化时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onPullDownRefresh()onPullDownRefreshuni-app 页面生命周期。用户下拉时触发,一般用于下拉刷新。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onReachBottom()onReachBottomuni-app 页面生命周期。页面滚动到底部时触发,一般用于触底加载数据。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onTabItemTap()onTabItemTapuni-app 页面生命周期。点击 Tab 时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onShareAppMessage()onShareAppMessageuni-app 页面生命周期。点击右上角分享时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onPageScroll()onPageScrolluni-app 页面生命周期。页面滚动时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onNavigationBarButtonTap()onNavigationBarButtonTapuni-app 页面生命周期。原生标题栏按钮被点击时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onBackPress()onBackPressuni-app 页面生命周期。页面返回时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onNavigationBarSearchInputChanged()onNavigationBarSearchInputChangeduni-app 页面生命周期。原生标题栏搜索输入框输入时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onNavigationBarSearchInputConfirmed()onNavigationBarSearchInputConfirmeduni-app 页面生命周期。原生标题栏搜索输入框确认搜索时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onNavigationBarSearchInputClicked()onNavigationBarSearchInputClickeduni-app 页面生命周期。原生标题栏点击搜索输入框时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onShareTimeline()onShareTimelineuni-app 页面生命周期。点击右上角转发到朋友圈时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
onAddToFavorites()onAddToFavoritesuni-app 页面生命周期。点击右上角收藏时触发。更多信息查看 https://uniapp.dcloud.io/collocation/frame/lifecycle?id=页面生命周期
uni.onAppShow()uni.onAppShowuni-app 应用级事件。监听启动或从后台进入前台。更多信息查看 https://uniapp.dcloud.io/api/application?id=onappshow
uni.offAppShow()uni.offAppShowuni-app 应用级事件。取消监听启动或从后台进入前台。更多信息查看 https://uniapp.dcloud.io/api/application?id=offappshow
uni.onAppHide()uni.onAppHideuni-app 应用级事件。监听从前台进入后台。更多信息查看 https://uniapp.dcloud.io/api/application?id=onapphide
uni.offAppHide()uni.offAppHideuni-app 应用级事件。取消监听从前台进入后台。更多信息查看 https://uniapp.dcloud.io/api/application?id=offapphide
uni.onPageNotFound()uni.onPageNotFounduni-app 应用级事件。监听页面不存在。更多信息查看 https://uniapp.dcloud.io/api/application?id=onpagenotfound
uni.offPageNotFound()uni.offPageNotFounduni-app 应用级事件。取消监听页面不存在。更多信息查看 https://uniapp.dcloud.io/api/application?id=offpagenotfound
uni.onError()uni.onErroruni-app 应用级事件。监听错误。更多信息查看 https://uniapp.dcloud.io/api/application?id=onerror
uni.offError()uni.offErroruni-app 应用级事件。取消监听错误。更多信息查看 https://uniapp.dcloud.io/api/application?id=offerror
uni.addInterceptor()uni.addInterceptoruni-app 添加拦截器。更多信息查看 https://uniapp.dcloud.io/api/interceptor?id=addinterceptor
uni.removeInterceptor()uni.removeInterceptoruni-app 移除拦截器。更多信息查看 https://uniapp.dcloud.io/api/interceptor?id=removeinterceptor
getApp()uni.getApp, getAppuni-app 获取当前应用实例,可以进一步获取 globalData。请考虑使用 vuex 实现同样的效果。更多信息查看 https://uniapp.dcloud.io/collocation/frame/window?id=getapp
getCurrentPages()uni.getCurrentPages, getCurrentPagesuni-app 获取当前页面栈实例,数组形式,第一个元素是首页。更多信息查看 https://uniapp.dcloud.io/collocation/frame/window?id=getcurrentpages
uni.$emit()uni.$emituni-app 触发全局自定义事件。过多的全局自定义事件容易导致代码混乱且难以调试,请控制全局自定义事件数量。更多信息查看 https://uniapp.dcloud.io/collocation/frame/communication?id=emit
uni.$on()uni.$onuni-app 监听全局自定义事件。过多的全局自定义事件容易导致代码混乱且难以调试,请控制全局自定义事件数量。更多信息查看 https://uniapp.dcloud.io/collocation/frame/communication?id=on
uni.$once()uni.$onceuni-app 一次性监听全局自定义事件。过多的全局自定义事件容易导致代码混乱且难以调试,请控制全局自定义事件数量。更多信息查看 https://uniapp.dcloud.io/collocation/frame/communication?id=once
uni.$off()uni.$offuni-app 移除全局自定义事件监听。过多的全局自定义事件容易导致代码混乱且难以调试,请控制全局自定义事件数量。更多信息查看 https://uniapp.dcloud.io/collocation/frame/communication?id=off
uni.addInterceptor()uni.addInterceptoruni-app 添加全局拦截器。过多的全局拦截器容易导致代码混乱且难以调试,请控制全局拦截器数量。更多信息查看 https://uniapp.dcloud.io/api/interceptor
uni.removeInterceptor()uni.removeInterceptoruni-app 移除全局拦截器。过多的全局拦截器容易导致代码混乱且难以调试,请控制全局拦截器数量。更多信息查看 https://uniapp.dcloud.io/api/interceptor
uni.request()uni.requestuni-app 发起网络请求。请考虑使用已经封装好的库,如 luch-request。更多信息查看 https://uniapp.dcloud.io/api/request/request
uni.uploadFile()uni.uploadFileuni-app 上传文件。请考虑使用已经封装好的库,如 luch-request。更多信息查看 https://uniapp.dcloud.io/api/request/network-file?id=uploadfile
uni.downloadFile()uni.downloadFileuni-app 下载文件。请考虑使用已经封装好的库,如 luch-request。更多信息查看 https://uniapp.dcloud.io/api/request/network-file?id=downloadfile
uni.connectSocket()uni.connectSocketuni-app 创建 WebSocket 连接。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=connectsocket
uni.onSocketOpen()uni.onSocketOpenuni-app 监听 WebSocket 连接打开。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=onsocketopen
uni.onSocketError()uni.onSocketErroruni-app 监听 WebSocket 错误。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=onsocketerror
uni.sendSocketMessage()uni.sendSocketMessageuni-app 通过 WebSocket 发送数据。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=sendsocketmessage
uni.onSocketMessage()uni.onSocketMessageuni-app 监听 WebSocket 接收消息。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=onsocketmessage
uni.closeSocket()uni.closeSocketuni-app 关闭 WebSocket 连接。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=closesocket
uni.onSocketClose()uni.onSocketCloseuni-app 监听 WebSocket 关闭。更多信息查看 https://uniapp.dcloud.io/api/request/websocket?id=onsocketclose
uni.navigateTo()uni.navigateTouni-app 保留当前页面,跳转到某个非 TabBar 页面。更多信息查看 https://uniapp.dcloud.io/api/router?id=navigateto
uni.redirectTo()uni.redirectTouni-app 关闭当前页面,跳转到某个非 Tab 页面。更多信息查看 https://uniapp.dcloud.io/api/router?id=redirectto
uni.reLaunch()uni.reLaunchuni-app 关闭所有页面,打开到某个页面。更多信息查看 https://uniapp.dcloud.io/api/router?id=relaunch
uni.switchTab()uni.switchTabuni-app 关闭所有非 TabBar 页面,跳转到 TabBar 页面。更多信息查看 https://uniapp.dcloud.io/api/router?id=switchtab
uni.navigateBack()uni.navigateBackuni-app 关闭当前页面并返回。更多信息查看 https://uniapp.dcloud.io/api/router?id=navigateback
uni.setStorage()uni.setStorageuni-app 异步存储本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=setstorage
uni.setStorageSync()uni.setStorageSyncuni-app 同步存储本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=setstoragesync
uni.getStorage()uni.getStorageuni-app 异步读取本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=getstorage
uni.getStorageSync()uni.getStorageSyncuni-app 同步读取本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=getstoragesync
uni.getStorageInfo()uni.getStorageInfouni-app 异步读取存储信息。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=getstorageinfo
uni.getStorageInfoSync()uni.getStorageInfoSyncuni-app 同步读取存储信息。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=getstorageinfosync
uni.removeStorage()uni.removeStorageuni-app 异步移除本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=removestorage
uni.removeStorageSync()uni.removeStorageSyncuni-app 同步移除本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=removestoragesync
uni.clearStorage()uni.clearStorageuni-app 异步清空本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=clearstorage
uni.clearStorageSync()uni.clearStorageSyncuni-app 同步清理本地数据。更多信息查看 https://uniapp.dcloud.io/api/storage/storage?id=clearstoragesync
uni.getLocation()uni.getLocationuni-app 获取当前地理位置。如果需要转换坐标到不同坐标系,建议使用已经封装好的库,如 gcoord 和 coordtransform。更多信息查看 https://uniapp.dcloud.io/api/location/location?id=getlocation
uni.chooseLocation()uni.chooseLocationuni-app 打开地图选择位置。更多信息查看 https://uniapp.dcloud.io/api/location/location?id=chooselocation
uni.openLocation()uni.openLocationuni-app 使用内置地图查看位置。更多信息查看 https://uniapp.dcloud.io/api/location/open-location
uni.createMapContext()uni.createMapContextuni-app 创建地图上下文对象。更多信息查看 https://uniapp.dcloud.io/api/location/map?id=createmapcontext
uni.chooseImage()uni.chooseImageuni-app 选择相册图片或使用相机拍照。更多信息查看 https://uniapp.dcloud.io/api/media/image?id=chooseimage
uni.previewImage()uni.previewImageuni-app 预览图片。更多信息查看 https://uniapp.dcloud.io/api/media/image?id=unipreviewimageobject
uni.getImageInfo()uni.getImageInfouni-app 获取图片信息。更多信息查看 https://uniapp.dcloud.io/api/media/image?id=getimageinfo
uni.saveImageToPhotosAlbum()uni.saveImageToPhotosAlbumuni-app 保存图片到相册。更多信息查看 https://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum
uni.compressImage()uni.compressImageuni-app 压缩图片。更多信息查看 https://uniapp.dcloud.io/api/media/image?id=compressimage
uni.chooseFile()uni.chooseFileuni-app 选择本地文件。更多信息查看 https://uniapp.dcloud.io/api/media/file?id=choosefile
uni.getRecorderManager()uni.getRecorderManageruni-app 获取全局唯一录音管理器。更多信息查看 https://uniapp.dcloud.io/api/media/record-manager?id=getrecordermanager
uni.getBackgroundAudioManager()uni.getBackgroundAudioManageruni-app 获取全局唯一背景音频管理器。更多信息查看 https://uniapp.dcloud.io/api/media/background-audio-manager?id=getbackgroundaudiomanager
uni.createInnerAudioContext()uni.createInnerAudioContextuni-app 创建音频上下文对象。更多信息查看 https://uniapp.dcloud.io/api/media/audio-context?id=createinneraudiocontext
uni.chooseVideo()uni.chooseVideouni-app 选择相册视频或使用相机录像。更多信息查看 https://uniapp.dcloud.io/api/media/video?id=choosevideo
uni.saveVideoToPhotosAlbum()uni.saveVideoToPhotosAlbumuni-app 保存视频到相册。更多信息查看 https://uniapp.dcloud.io/api/media/video?id=savevideotophotosalbum
uni.createVideoContext()uni.createVideoContextuni-app 创建视频上下文对象。更多信息查看 https://uniapp.dcloud.io/api/media/video-context?id=createvideocontext
uni.createCameraContext()uni.createCameraContextuni-app 创建相机上下文对象。更多信息查看 https://uniapp.dcloud.io/api/media/camera-context?id=createcameracontext
uni.createLivePlayerContext()uni.createLivePlayerContextuni-app 创建直播拉流上下文对象。更多信息查看 https://uniapp.dcloud.io/api/media/live-player-context?id=createliveplayercontext
uni.createLivePusherContext()uni.createLivePusherContextuni-app 创建直播推流上下文对象。更多信息查看 https://uniapp.dcloud.io/api/media/live-player-context?id=createlivepushercontext
uni.getSystemInfo()uni.getSystemInfouni-app 异步获取系统信息。更多信息查看 https://uniapp.dcloud.io/api/system/info?id=getsysteminfo
uni.getSystemInfoSync()uni.getSystemInfoSyncuni-app 同步获取系统信息。更多信息查看 https://uniapp.dcloud.io/api/system/info?id=getsysteminfosync
uni.canIUse()uni.canIUseuni-app 判断 API、回调、参数、组件等是否在当前版本可用。更多信息查看 https://uniapp.dcloud.io/api/system/info?id=caniuse
uni.onMemoryWarning()uni.onMemoryWarninguni-app 内存不足告警时触发。更多信息查看 https://uniapp.dcloud.io/api/system/memory
uni.getNetworkType()uni.getNetworkTypeuni-app 获取网络类型。更多信息查看 https://uniapp.dcloud.io/api/system/network?id=getnetworktype
uni.onNetworkStatusChange()uni.onNetworkStatusChangeuni-app 监听网络状态变化。更多信息查看 https://uniapp.dcloud.io/api/system/network?id=onnetworkstatuschange
uni.offNetworkStatusChange()uni.offNetworkStatusChangeuni-app 取消监听网络状态变化。更多信息查看 https://uniapp.dcloud.io/api/system/network?id=offnetworkstatuschange
uni.onThemeChange()uni.onThemeChangeuni-app 监听系统主题状态变化。更多信息查看 https://uniapp.dcloud.io/api/system/theme
uni.onAccelerometerChange()uni.onAccelerometerChangeuni-app 监听加速度数据。更多信息查看 https://uniapp.dcloud.io/api/system/accelerometer?id=onaccelerometerchange
uni.offAccelerometerChange()uni.offAccelerometerChangeuni-app 取消监听加速度数据。更多信息查看 https://uniapp.dcloud.io/api/system/accelerometer?id=offaccelerometerchange
uni.startAccelerometer()uni.startAccelerometeruni-app 开始监听加速度数据。更多信息查看 https://uniapp.dcloud.io/api/system/accelerometer?id=startaccelerometer
uni.stopAccelerometer()uni.stopAccelerometeruni-app 停止监听加速度数据。更多信息查看 https://uniapp.dcloud.io/api/system/accelerometer?id=stopaccelerometer
uni.onCompassChange()uni.onCompassChangeuni-app 监听罗盘数据。更多信息查看 https://uniapp.dcloud.io/api/system/compass?id=oncompasschange
uni.offCompassChange()uni.offCompassChangeuni-app 取消监听罗盘数据。更多信息查看 https://uniapp.dcloud.io/api/system/compass?id=offcompasschange
uni.startCompass()uni.startCompassuni-app 开始监听罗盘数据。更多信息查看 https://uniapp.dcloud.io/api/system/compass?id=startcompass
uni.stopCompass()uni.stopCompassuni-app 停止监听罗盘数据。更多信息查看 https://uniapp.dcloud.io/api/system/compass?id=stopcompass
uni.onGyroscopeChange()uni.onGyroscopeChangeuni-app 监听陀螺仪数据。更多信息查看 https://uniapp.dcloud.io/api/system/gyroscope?id=ongyroscopechange
uni.offGyroscopeChange()uni.offGyroscopeChangeuni-app 取消监听陀螺仪数据。更多信息查看 https://uniapp.dcloud.io/api/system/gyroscope?id=offgyroscopechange
uni.startGyroscope()uni.startGyroscopeuni-app 开始监听陀螺仪数据。更多信息查看 https://uniapp.dcloud.io/api/system/gyroscope?id=startgyroscope
uni.stopGyroscope()uni.stopGyroscopeuni-app 停止监听陀螺仪数据。更多信息查看 https://uniapp.dcloud.io/api/system/gyroscope?id=stopgyroscope
uni.makePhoneCall()uni.makePhoneCalluni-app 拨打电话。更多信息查看 https://uniapp.dcloud.io/api/system/phone
uni.scanCode()uni.scanCodeuni-app 扫码。更多信息查看 https://uniapp.dcloud.io/api/system/barcode
uni.setClipboardData()uni.setClipboardDatauni-app 设置剪贴板内容。更多信息查看 https://uniapp.dcloud.io/api/system/clipboard
uni.getClipboardData()uni.getClipboardDatauni-app 获取剪贴板内容。更多信息查看 https://uniapp.dcloud.io/api/system/clipboard
uni.setScreenBrightness()uni.setScreenBrightnessuni-app 设置屏幕亮度。更多信息查看 https://uniapp.dcloud.io/api/system/brightness?id=setscreenbrightness
uni.getScreenBrightness()uni.getScreenBrightnessuni-app 获取屏幕亮度。更多信息查看 https://uniapp.dcloud.io/api/system/brightness?id=getscreenbrightness
uni.setKeepScreenOn()uni.setKeepScreenOnuni-app 设置屏幕亮度。更多信息查看 https://uniapp.dcloud.io/api/system/brightness?id=setkeepscreenon
uni.onUserCaptureScreen()uni.onUserCaptureScreenuni-app 监听截屏。更多信息查看 https://uniapp.dcloud.io/api/system/capture-screen
uni.vibrate()uni.vibrateuni-app 使手机振动。更多信息查看 https://uniapp.dcloud.io/api/system/vibrate?id=vibrate
uni.vibrateLong()uni.vibrateLonguni-app 使手机长振动。更多信息查看 https://uniapp.dcloud.io/api/system/vibrate?id=vibratelong
uni.vibrateShort()uni.vibrateShortuni-app 使手机短振动。更多信息查看 https://uniapp.dcloud.io/api/system/vibrate?id=vibrateshort
uni.addPhoneContact()uni.addPhoneContactuni-app 添加手机联系人。更多信息查看 https://uniapp.dcloud.io/api/system/contact
uni.openBluetoothAdapter()uni.openBluetoothAdapteruni-app 初始化蓝牙模块。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.startBluetoothDevicesDiscovery()uni.startBluetoothDevicesDiscoveryuni-app 开始搜寻蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.onBluetoothDeviceFound()uni.onBluetoothDeviceFounduni-app 监听搜寻到蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.stopBluetoothDevicesDiscovery()uni.stopBluetoothDevicesDiscoveryuni-app 停止搜寻蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.onBluetoothAdapterStateChange()uni.onBluetoothAdapterStateChangeuni-app 监听蓝牙适配器状态变化。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.getConnectedBluetoothDevices()uni.getConnectedBluetoothDevicesuni-app 根据 uuid 获取已经连接的蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.getBluetoothDevices()uni.getBluetoothDevicesuni-app 获取蓝牙模块生效期间所有已发现的蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.getBluetoothAdapterState()uni.getBluetoothAdapterStateuni-app 获取蓝牙适配器状态。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.getBluetoothAdapterState()uni.closeBluetoothAdapteruni-app 关闭蓝牙模块。更多信息查看 https://uniapp.dcloud.io/api/system/bluetooth
uni.setBLEMTU()uni.setBLEMTUuni-app 设置蓝牙最大传输单元。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.writeBLECharacteristicValue()uni.writeBLECharacteristicValueuni-app 向低功耗蓝牙设备特征值写入二进制数据。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.readBLECharacteristicValue()uni.readBLECharacteristicValueuni-app 读取低功耗蓝牙设备特征值的二进制数据。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.onBLEConnectionStateChange()uni.onBLEConnectionStateChangeuni-app 监听低功耗蓝牙连接状态改变。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.onBLECharacteristicValueChange()uni.onBLECharacteristicValueChangeuni-app 监听低功耗蓝牙设备特征值变化。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.notifyBLECharacteristicValueChange()uni.notifyBLECharacteristicValueChangeuni-app 启用低功耗蓝牙设备特征值变化时的 notify 功能。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.getBLEDeviceServices()uni.getBLEDeviceServicesuni-app 获取蓝牙设备所有服务。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.getBLEDeviceRSSI()uni.getBLEDeviceRSSIuni-app 获取蓝牙设备信号强度。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.getBLEDeviceCharacteristics()uni.getBLEDeviceCharacteristicsuni-app 获取蓝牙设备某个服务所有特征值。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.createBLEConnection()uni.createBLEConnectionuni-app 连接低功耗蓝牙设备。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.closeBLEConnection()uni.closeBLEConnectionuni-app 断开与低功耗蓝牙设备的连接。更多信息查看 https://uniapp.dcloud.io/api/system/ble
uni.onBeaconServiceChange()uni.onBeaconServiceChangeuni-app 监听 iBeacon 服务状态变化。更多信息查看 https://uniapp.dcloud.io/api/system/ibeacon
uni.onBeaconUpdate()uni.onBeaconUpdateuni-app 监听 iBeacon 设备更新。更多信息查看 https://uniapp.dcloud.io/api/system/ibeacon
uni.getBeacons()uni.getBeaconsuni-app 获取所有已搜索到的 iBeacon 设备。更多信息查看 https://uniapp.dcloud.io/api/system/ibeacon
uni.startBeaconDiscovery()uni.startBeaconDiscoveryuni-app 开始搜索附近 iBeacon 设备。更多信息查看 https://uniapp.dcloud.io/api/system/ibeacon
uni.stopBeaconDiscovery()uni.stopBeaconDiscoveryuni-app 停止搜索附近 iBeacon 设备。更多信息查看 https://uniapp.dcloud.io/api/system/ibeacon
uni.startSoterAuthentication()uni.startSoterAuthenticationuni-app 开始 SOTER 生物认证。更多信息查看 https://uniapp.dcloud.io/api/system/authentication?id=startsoterauthentication
uni.checkIsSupportSoterAuthentication()uni.checkIsSupportSoterAuthenticationuni-app 获取支持的 SOTER 生物认证方式。更多信息查看 https://uniapp.dcloud.io/api/system/authentication?id=checkissupportsoterauthentication
uni.checkIsSoterEnrolledInDevice()uni.checkIsSoterEnrolledInDeviceuni-app 获取设备内是否录入生物信息。更多信息查看 https://uniapp.dcloud.io/api/system/authentication?id=checkissoterenrolledindevice
uni.hideKeyboard()uni.hideKeyboarduni-app 隐藏软键盘。更多信息查看 https://uniapp.dcloud.io/api/key?id=hidekeyboard
uni.onKeyboardHeightChange()uni.onKeyboardHeightChangeuni-app 监听键盘高度变化。更多信息查看 https://uniapp.dcloud.io/api/key?id=onkeyboardheightchange
uni.offKeyboardHeightChange()uni.offKeyboardHeightChangeuni-app 取消监听键盘高度变化。更多信息查看 https://uniapp.dcloud.io/api/key?id=offkeyboardheightchange
uni.getSelectedTextRange()uni.getSelectedTextRangeuni-app 监听键盘高度变化。更多信息查看 https://uniapp.dcloud.io/api/key?id=getselectedtextrange
uni.showToast()uni.showToastuni-app 显示消息提示框。这可能与加载提示框冲突,请在测试时以真机测试为准。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=showtoast
uni.hideToast()uni.hideToastuni-app 隐藏消息提示框。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=hidetoast
uni.showLoading()uni.showLoadinguni-app 显示加载中提示框。这可能与消息提示框冲突,请在测试时以真机测试为准。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=showloading
uni.hideLoading()uni.hideLoadinguni-app 隐藏加载中提示框。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=hideloading
uni.showModal()uni.showModaluni-app 显示模态弹窗。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=showmodal
uni.showActionSheet()uni.showActionSheetuni-app 显示操作菜单。更多信息查看 https://uniapp.dcloud.io/api/ui/prompt?id=showactionsheet
uni.setNavigationBarTitle()uni.setNavigationBarTitleuni-app 动态设置当前页面标题。更多信息查看 https://uniapp.dcloud.io/api/ui/navigationbar?id=setnavigationbartitle
uni.setNavigationBarColor()uni.setNavigationBarColoruni-app 设置页面导航条颜色。更多信息查看 https://uniapp.dcloud.io/api/ui/navigationbar?id=setnavigationbarcolor
uni.showNavigationBarLoading()uni.showNavigationBarLoadinguni-app 在当前页面显示导航条加载动画。更多信息查看 https://uniapp.dcloud.io/api/ui/navigationbar?id=shownavigationbarloading
uni.hideNavigationBarLoading()uni.hideNavigationBarLoadinguni-app 在当前页面隐藏导航条加载动画。更多信息查看 https://uniapp.dcloud.io/api/ui/navigationbar?id=hidenavigationbarloading
uni.hideHomeButton()uni.hideHomeButtonuni-app 隐藏返回首页按钮。更多信息查看 https://uniapp.dcloud.io/api/ui/navigationbar?id=hidehomebutton
uni.setTabBarItem()uni.setTabBarItemuni-app 动态设置 TabBar 某一项内容。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=settabbaritem
uni.setTabBarStyle()uni.setTabBarStyleuni-app 动态设置 TabBar 整体样式。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=settabbarstyle
uni.hideTabBar()uni.hideTabBaruni-app 隐藏 TabBar。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbar
uni.showTabBar()uni.showTabBaruni-app 显示 TabBar。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=showtabbar
uni.setTabBarBadge()uni.setTabBarBadgeuni-app 设置 TabBar 某一项徽标。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=settabbarbadge
uni.removeTabBarBadge()uni.removeTabBarBadgeuni-app 移除 tabBar 某一项徽标。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=removetabbarbadge
uni.showTabBarRedDot()uni.showTabBarRedDotuni-app 设置 TabBar 某一项红点。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=showtabbarreddot
uni.hideTabBarRedDot()uni.hideTabBarRedDotuni-app 移除 tabBar 某一项红点。更多信息查看 https://uniapp.dcloud.io/api/ui/tabbar?id=hidetabbarreddot
uni.setBackgroundColor()uni.setBackgroundColoruni-app 动态设置窗口背景色。更多信息查看 https://uniapp.dcloud.io/api/ui/bgcolor?id=setbackgroundcolor
uni.setBackgroundTextStyle()uni.setBackgroundTextStyleuni-app 动态设置下拉背景字体、加载图的样式。更多信息查看 https://uniapp.dcloud.io/api/ui/bgcolor?id=setbackgroundtextstyle
uni.createAnimation()uni.createAnimationuni-app 创建动画实例。更多信息查看 https://uniapp.dcloud.io/api/ui/animation
uni.pageScrollTo()uni.pageScrollTouni-app 将页面滚动到目标位置。更多信息查看 https://uniapp.dcloud.io/api/ui/scroll
uni.onWindowResize()uni.onWindowResizeuni-app 监听窗口尺寸变化。更多信息查看 https://uniapp.dcloud.io/api/ui/window?id=onwindowresize
uni.offWindowResize()uni.offWindowResizeuni-app 取消监听窗口尺寸变化。更多信息查看 https://uniapp.dcloud.io/api/ui/window?id=offwindowresize
uni.getTopWindowStyle()uni.getTopWindowStyleuni-app 获取 topWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=gettopwindowstyle
uni.getLeftWindowStyle()uni.getLeftWindowStyleuni-app 获取 leftWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=getleftwindowstyle
uni.getRightWindowStyle()uni.getRightWindowStyleuni-app 获取 rightWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=getrightwindowstyle
uni.setTopWindowStyle()uni.setTopWindowStyleuni-app 设置 topWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=settopwindowstyle
uni.setLeftWindowStyle()uni.setLeftWindowStyleuni-app 设置 leftWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=setleftwindowstyle
uni.setRightWindowStyle()uni.setRightWindowStyleuni-app 设置 rightWindow 样式。更多信息查看 https://uniapp.dcloud.io/api/ui/adapt?id=setrightwindowstyle
uni.loadFontFace()uni.loadFontFaceuni-app 动态加载网络字体。更多信息查看 https://uniapp.dcloud.io/api/ui/font
uni.startPullDownRefresh()uni.startPullDownRefreshuni-app 开始下拉刷新。更多信息查看 https://uniapp.dcloud.io/api/ui/pulldown?id=startpulldownrefresh
uni.stopPullDownRefresh()uni.stopPullDownRefreshuni-app 停止下拉刷新。更多信息查看 https://uniapp.dcloud.io/api/ui/pulldown?id=startpulldownrefresh
uni.createSelectorQuery()uni.createSelectorQueryuni-app 创建查询节点信息的实例。更多信息查看 https://uniapp.dcloud.io/api/ui/nodes-info
uni.getMenuButtonBoundingClientRect()uni.getMenuButtonBoundingClientRectuni-app 获取菜单按钮信息。更多信息查看 https://uniapp.dcloud.io/api/ui/menuButton
uni.saveFile()uni.saveFileuni-app 保存文件到本地。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=savefile
uni.getSavedFileList()uni.getSavedFileListuni-app 获取本地已保存的文件列表。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=getsavedfilelist
uni.getSavedFileInfo()uni.getSavedFileInfouni-app 获取本地文件的文件信息。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=getsavedfileinfo
uni.removeSavedFile()uni.removeSavedFileuni-app 删除本地存储的文件。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=removesavedfile
uni.uni.getFileInfo()uni.getFileInfouni-app 获取文件信息。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=getfileinfo
uni.openDocument()uni.openDocumentuni-app 新开页面打开文档。更多信息查看 https://uniapp.dcloud.io/api/file/file?id=opendocument
uni.createCanvasContext()uni.createCanvasContextuni-app 创建画布上下文。更多信息查看 https://uniapp.dcloud.io/api/canvas/createCanvasContext
uni.canvasToTempFilePath()uni.canvasToTempFilePathuni-app 导出画布内容。更多信息查看 https://uniapp.dcloud.io/api/canvas/canvasToTempFilePath
uni.canvasPutImageData()uni.canvasPutImageDatauni-app 将像素数据绘制到画布。更多信息查看 https://uniapp.dcloud.io/api/canvas/canvasPutImageData
uni.canvasGetImageData()uni.canvasGetImageDatauni-app 获取画布的像素数据。更多信息查看 https://uniapp.dcloud.io/api/canvas/canvasGetImageData
uni.getProvider()uni.getProvideruni-app 获取服务供应商。更多信息查看 https://uniapp.dcloud.io/api/plugins/provider
uni.login()uni.loginuni-app 登录。更多信息查看 https://uniapp.dcloud.io/api/plugins/login?id=login
uni.checkSession()uni.checkSessionuni-app 检查登录状态。更多信息查看 https://uniapp.dcloud.io/api/plugins/login?id=unichecksession
uni.getUserInfo()uni.getUserInfouni-app 检查登录状态。更多信息查看 https://uniapp.dcloud.io/api/plugins/login?id=unichecksession
uni.share()uni.shareuni-app 分享。更多信息查看 https://uniapp.dcloud.io/api/plugins/share?id=share
uni.showShareMenu()uni.showShareMenuuni-app 原生菜单显示分享按钮。更多信息查看 https://uniapp.dcloud.io/api/plugins/share?id=showsharemenu
uni.hideShareMenu()uni.hideShareMenuuni-app 原生菜单隐藏分享按钮。更多信息查看 https://uniapp.dcloud.io/api/plugins/share?id=hidesharemenu
uni.requestPayment()uni.requestPaymentuni-app 支付。更多信息查看 https://uniapp.dcloud.io/api/plugins/payment
uni.authorize()uni.authorizeuni-app 授权。更多信息查看 https://uniapp.dcloud.io/api/other/authorize
uni.getSetting()uni.openSettinguni-app 打开设置界面。更多信息查看 https://uniapp.dcloud.io/api/other/setting?id=opensetting
uni.getSetting()uni.getSettinguni-app 获取当前设置。更多信息查看 https://uniapp.dcloud.io/api/other/setting?id=getsetting
uni.chooseAddress()uni.chooseAddressuni-app 获取收货地址。更多信息查看 https://uniapp.dcloud.io/api/other/choose-address
uni.chooseInvoiceTitle()uni.chooseInvoiceTitleuni-app 选择发票抬头。更多信息查看 https://uniapp.dcloud.io/api/other/invoice-title
uni.navigateToMiniProgram()uni.navigateToMiniProgramuni-app 打开小程序。更多信息查看 https://uniapp.dcloud.io/api/other/open-miniprogram?id=navigatetominiprogram
uni.navigateBackMiniProgram()uni.navigateBackMiniProgramuni-app 从打开的小程序返回。更多信息查看 https://uniapp.dcloud.io/api/other/open-miniprogram?id=navigatebackminiprogram
uni.getAccountInfoSync()uni.getAccountInfoSyncuni-app 同步获取账号信息。更多信息查看 https://uniapp.dcloud.io/api/other/getAccountInfoSync
uni.report()uni.reportuni-app 统计。更多信息查看 https://uniapp.dcloud.io/api/other/report
uni.getUpdateManager()uni.getUpdateManageruni-app 获取全局唯一版本更新管理器。更多信息查看 https://uniapp.dcloud.io/api/other/update
uni.setEnabledDebug()uni.setEnableDebuguni-app 设置调试开关。更多信息查看 https://uniapp.dcloud.io/api/other/set-enable-debug

额外推荐

请查看 uni-helper 插件说明

Released under the MIT License.