提交 63d339f0 编写于 作者: D DCloud_LXH

update: 优化部分文档结构,优化 toc 显示

上级 97525f24
......@@ -137,12 +137,12 @@ export default {
this.sideBar && this.sideBar.removeAttribute('style')
this.vuepressToc && this.vuepressToc.removeAttribute('style')
this.navbar && this.navbar.removeAttribute('style')
this.pageContainer && this.pageContainer.removeAttribute('style')
this.pageContainer && (this.pageContainer.style.marginTop = 'auto')
},
onWindowScroll () {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
{
if (!this.fixedNavbar) {
let sideTop = this.navbarHeight - scrollTop
sideTop <= this.subNavBarHeight && (sideTop = this.subNavBarHeight)
this.sideBar && (this.sideBar.style.top = `${sideTop + 1}px`)
......@@ -160,10 +160,18 @@ export default {
} else if (scrollTop < this.mainNavBarHeight) {
if (this.fixedNavbar) {
this.fixedNavbar = false
this.pageContainer && this.pageContainer.removeAttribute('style')
this.pageContainer && (this.pageContainer.style.marginTop = 'auto')
}
}
},
fixedSideBarHeight () {
if(!os.pc) return
this.navbarHeight = this.navbar.clientHeight
this.subNavBarHeight = this.subNavBar.clientHeight
const setHeight = this.fixedNavbar ? this.subNavBarHeight : this.navbarHeight
this.sideBar.style.top = `${setHeight + 1}px`
this.vuepressToc.style.top = `${setHeight + 1}px`
},
mainNavLinkClass (index) {
return ['main-navbar-item', this.navConfig.userNavIndex === index ? 'active' : '']
},
......@@ -179,13 +187,12 @@ export default {
},
watch: {
fixedNavbar () {
this.fixedSideBarHeight()
},
'navConfig.userNavIndex' () {
this.$nextTick(()=>{
if(!os.pc) return
this.navbarHeight = this.navbar.clientHeight
this.subNavBarHeight = this.subNavBar.clientHeight
this.sideBar.style.top = `${this.navbarHeight + 1}px`
this.vuepressToc.style.top = `${this.navbarHeight + 1}px`
this.fixedSideBarHeight()
})
}
}
......
<template>
<Sticker v-if="visible" class="vuepress-toc" v-bind="$attrs" :style="{ top: initVisibleTop }">
<Sticker v-show="visible" class="vuepress-toc" v-bind="$attrs" :style="{ top: initVisibleTop }">
<h5>ON THIS PAGE</h5>
<div
v-for="(item, index) in $page.headers"
......@@ -15,6 +15,7 @@
<script>
import Sticker from './Sticker.vue';
import toc from '../mixin/toc';
let initTop;
// get offset top
function getAbsoluteTop(dom) {
......@@ -25,6 +26,7 @@
: 0;
}
export default {
mixins: [ toc ],
components: {
Sticker,
},
......@@ -34,15 +36,6 @@
initVisibleTop: '0px',
};
},
computed: {
visible() {
return (
this.$frontmatter &&
this.$frontmatter.toc !== false
// && !!(this.$page && this.$page.headers && this.$page.headers.length)
);
},
},
watch: {
activeIndex() {
const items = this.$refs.chairTocItem || [];
......@@ -78,6 +71,8 @@
};
window.addEventListener('scroll', this._onScroll);
// window.addEventListener('hashchange', this._onHashChange);
const sideBar = document.querySelector('.sidebar');
this.initVisibleTop = sideBar && sideBar.style && sideBar.style.top;
},
beforeDestroy() {
window.removeEventListener('scroll', this._onScroll);
......
......@@ -34,6 +34,7 @@
<Page
v-else
:sidebar-items="sidebarItems"
:style="pageStyle"
>
<template #top>
<slot name="page-top" />
......@@ -58,10 +59,11 @@ import SiderBarBottom from '../components/SiderBarBottom.vue';
import Toc from '../components/Toc';
import { resolveSidebarItems, forbidScroll, BaiduStat } from '../util'
import navProvider from '../mixin/navProvider';
import toc from '../mixin/toc';
export default {
name: 'Layout',
mixins: [ navProvider ],
mixins: [ navProvider, toc ],
components: {
Home,
Page,
......@@ -119,6 +121,13 @@ export default {
},
userPageClass
]
},
pageStyle () {
const style = {};
!this.visible && (style.paddingRight = '0px');
return style;
}
},
mounted () {
......
export default {
computed: {
visible() {
return (
this.$frontmatter &&
this.$frontmatter.toc !== false &&
!!(this.$page && this.$page.headers && this.$page.headers.length) &&
this.$page.headers.some(header => header.level > 2)
);
},
}
}
\ No newline at end of file
......@@ -621,6 +621,15 @@ uni.addInterceptor({
| [uni.switchTab](/api/router?id=switchtab) | 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 |
| [uni.navigateBack](/api/router?id=navigateback) | 关闭当前页面,返回上一页面或多级页面 |
#### 键盘
| API | 说明 |
| :---------------------------------------------- | :--------------------------------------------------------------------------- |
| [uni.hideKeyboard](/api/key.html#hidekeyboard) | 隐藏已经显示的软键盘,如果软键盘没有显示则不做任何操作。 |
| [uni.onKeyboardHeightChange](/api/key.html#onkeyboardheightchange) | 监听键盘高度变化 |
| [uni.offKeyboardHeightChange](/api/key.html#offkeyboardheightchange) | 取消监听键盘高度变化事件 |
| [uni.getSelectedTextRange](/api/key?id=getselectedtextrange) | 在input、textarea等focus之后,获取输入框的光标位置 |
#### 第三方服务
| API | 说明 |
......
......@@ -21,18 +21,19 @@
* [uni.reLaunch](/api/router?id=relaunch)
* [uni.switchTab](/api/router?id=switchtab)
* [uni.navigateBack](/api/router?id=navigateback)
* [EventChannel](/api/router#event-channel)
* [uni.preloadPage](/api/preload-page)
* [窗口动画](/api/router?id=animation)
* [数据缓存](/api/storage/storage)
* [uni.setStorage](/api/storage/storage?id=setstorage)
* [uni.setStorageSync](/api/storage/storage?id=setStorageSync)
* [uni.getStorage](/api/storage/storage?id=getStorage)
* [uni.getStorageSync](/api/storage/storage?id=getStorageSync)
* [uni.getStorageInfo](/api/storage/storage?id=getStorageInfo)
* [uni.getStorageInfoSync](/api/storage/storage?id=getStorageInfoSync)
* [uni.removeStorage](/api/storage/storage?id=removeStorage)
* [uni.removeStorageSync](/api/storage/storage?id=removeStorageSync)
* [uni.clearStorage](/api/storage/storage?id=clearStorage)
* [uni.setStorageSync](/api/storage/storage?id=setstoragesync)
* [uni.getStorage](/api/storage/storage?id=getstorage)
* [uni.getStorageSync](/api/storage/storage?id=getstoragesync)
* [uni.getStorageInfo](/api/storage/storage?id=getstorageinfo)
* [uni.getStorageInfoSync](/api/storage/storage?id=getstorageinfosync)
* [uni.removeStorage](/api/storage/storage?id=removestorage)
* [uni.removeStorageSync](/api/storage/storage?id=removestoragesync)
* [uni.clearStorage](/api/storage/storage?id=clearstorage)
* [uni.clearStorageSync](/api/storage/storage?id=clearstoragesync)
* 位置
* [获取位置](api/location/location.md)
......@@ -78,6 +79,7 @@
* [uni.hideKeyboard](/api/key?id=hidekeyboard)
* [uni.onKeyboardHeightChange](/api/key?id=onkeyboardheightchange)
* [uni.offKeyboardHeightChange](/api/key?id=offkeyboardheightchange)
* [uni.getSelectedTextRange](/api/key?id=getselectedtextrange)
* 界面
* [交互反馈](api/ui/prompt.md)
* [设置导航条](api/ui/navigationbar.md)
......@@ -101,11 +103,11 @@
* [subNVue原生子窗体](api/window/subNVues.md)
* [文件](/api/file/file)
* [uni.saveFile](/api/file/file?id=savefile)
* [uni.getSavedFileList](/api/file/file?id=getSavedFileList)
* [uni.getSavedFileInfo](/api/file/file?id=getSavedFileInfo)
* [uni.removeSavedFile](/api/file/file?id=removeSavedFile)
* [uni.getFileInfo](/api/file/file?id=getFileInfo)
* [uni.openDocument](/api/file/file?id=openDocument)
* [uni.getSavedFileList](/api/file/file?id=getsavedfilelist)
* [uni.getSavedFileInfo](/api/file/file?id=getsavedfileinfo)
* [uni.removeSavedFile](/api/file/file?id=removesavedfile)
* [uni.getFileInfo](/api/file/file?id=getfileinfo)
* [uni.openDocument](/api/file/file?id=opendocument)
* [uni.getFileSystemManager](/api/file/getFileSystemManager)
* 绘画
* [uni.createOffscreenCanvas](api/canvas/createOffscreenCanvas.md)
......
#### uni.canvasGetImageData(OBJECT,this)
### uni.canvasGetImageData(OBJECT,this)
返回一个数组,用来描述 canvas 区域隐含的像素数据,在自定义组件下,第二个参数传入自定义组件实例 this,以操作组件内 `<canvas>` 组件。
......
#### uni.canvasPutImageData(OBJECT,this)
### uni.canvasPutImageData(OBJECT,this)
将像素数据绘制到画布的方法,在自定义组件下,第二个参数传入自定义组件实例 this,以操作组件内 `<canvas>` 组件
......
#### uni.canvasToTempFilePath(object, component)
### uni.canvasToTempFilePath(object, component)
把当前画布指定区域的内容导出生成指定大小的图片,并返回文件路径。在自定义组件下,第二个参数传入自定义组件实例,以操作组件内 `<canvas>` 组件。
......
#### uni.createCanvasContext(canvasId, this)
### uni.createCanvasContext(canvasId, this)
#### 定义
......
#### uni.createOffscreenCanvas()
### uni.createOffscreenCanvas()
创建离屏 canvas 实例
......
#### uni.saveFile(OBJECT)
### uni.saveFile(OBJECT) @savefile
保存文件到本地。
**平台差异说明**
......@@ -40,7 +40,7 @@ uni.chooseImage({
});
```
#### uni.getSavedFileList(OBJECT)
### uni.getSavedFileList(OBJECT) @getsavedfilelist
获取本地已保存的文件列表。
**平台差异说明**
......@@ -82,7 +82,7 @@ uni.getSavedFileList({
});
```
#### uni.getSavedFileInfo(OBJECT)
### uni.getSavedFileInfo(OBJECT) @getsavedfileinfo
获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件。
**平台差异说明**
......@@ -120,7 +120,7 @@ uni.getSavedFileInfo({
});
```
#### uni.removeSavedFile(OBJECT)
### uni.removeSavedFile(OBJECT) @removesavedfile
删除本地存储的文件。
**平台差异说明**
......@@ -155,7 +155,7 @@ uni.getSavedFileList({
});
```
#### uni.getFileInfo(OBJECT)
### uni.getFileInfo(OBJECT) @getfileinfo
获取文件信息
**平台差异说明**
......@@ -182,7 +182,7 @@ uni.getSavedFileList({
|size|Number|文件大小,以字节为单位。||
|digest|String|按照传入的 digestAlgorithm 计算得出的的文件摘要|微信小程序、京东小程序、App 2.9.0+|
#### uni.openDocument(OBJECT)
### uni.openDocument(OBJECT) @opendocument
新开页面打开文档,支持格式:doc, xls, ppt, pdf, docx, xlsx, pptx。
**平台差异说明**
......
#### uni.hideKeyboard()
### uni.hideKeyboard()
隐藏软键盘
......@@ -11,7 +11,7 @@
|√|√|√|√|x|√|√|√|√|
#### uni.onKeyboardHeightChange(CALLBACK) @onkeyboardheightchange
### uni.onKeyboardHeightChange(CALLBACK) @onkeyboardheightchange
监听键盘高度变化
......@@ -35,7 +35,7 @@ uni.onKeyboardHeightChange(res => {
})
```
#### uni.offKeyboardHeightChange(CALLBACK) @offkeyboardheightchange
### uni.offKeyboardHeightChange(CALLBACK) @offkeyboardheightchange
取消监听键盘高度变化事件
......@@ -51,7 +51,7 @@ uni.onKeyboardHeightChange(res => {
uni.offKeyboardHeightChange(callback)
```
#### uni.getSelectedTextRange(OBJECT)
### uni.getSelectedTextRange(OBJECT) @getselectedtextrange
在input、textarea等focus之后,获取输入框的光标位置。注意:只有在focus的时候调用此接口才有效。目前仅支持 vue 页面,nvue 可以直接使用 weex 的 [getSelectionRange](https://weex.apache.org/zh/docs/components/input.html#getSelectionRange)
......
......@@ -88,7 +88,7 @@ uni.chooseFile({
})
```
# wx.chooseMessageFile(OBJECT)
### wx.chooseMessageFile(OBJECT)
从微信聊天会话中选择文件。
......
......@@ -271,7 +271,7 @@ uni.chooseImage({
});
```
# uni.compressImage(OBJECT)
### uni.compressImage(OBJECT)
压缩图片接口,可选压缩质量
......
**一键生成iOS通用链接**
#### 背景介绍:
### 背景介绍:
> Universal Link是苹果在WWDC 2015上提出的iOS 9的新特性之一。此特性类似于深层链接,并能够方便地通过打开一个Https链接来直接启动您的客户端应用(手机有安装App)。对比以往所使用的URLSheme, 这种新特性在实现web-app的无缝链接时,能够提供极佳的用户体验。
> 使用前请阅读[苹果官方文档](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1)。
......@@ -31,14 +31,14 @@ Error: not set parameter 'UniversalLinks' @'oauth-weixin'
现在通过HBuilderX(3.1.9版起)云打包,支持自动生成apple-app-site-association文件,并自动托管到:自带cdn、ssl等服务的“免费”的云服务空间[uniCloud的前端网页托管](https://uniapp.dcloud.io/uniCloud/hosting),自动完成manifest.json中的相关配置。用自动化技术替代了,如上所示传统方式令人苦恼的(2-5)4个步骤;只需如下三步直接搞定通用链接。
#### 第一步:开启Associated Domains服务
### 第一步:开启Associated Domains服务
登录[苹果开发者网站](https://developer.apple.com/),在“Certificates, Identifiers & Profiles”页面选择“Identifiers”中选择对应的App ID,确保开启Associated Domains服务
![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/2eae9f97-2c4a-4dc8-97e8-e665b0c660e1.png)
**开启Associated Domains服务后需要重新生成profile文件,提交云端打包时使用**
#### 第二步骤 自动生成通用连接(Universal Links)
### 第二步骤 自动生成通用连接(Universal Links)
HBuilderX (3.2.0 版本起) 新增QQ互联和新浪微博开放平台的通用链接的设置。以微信模块为例,QQ与微博与之类似。
打开项目的manifest.json文件,在“(App) SDK配置”项中的微信登录(微信分享、微信支付)下的“iOS平台通用链接(Universal Links)”中,
......@@ -54,43 +54,43 @@ HBuilderX (3.2.0 版本起) 新增QQ互联和新浪微博开放平台的通用
![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-f184e7c3-1912-41b2-b81f-435d1b37c7b4/1e081fdd-27b2-4c0b-8985-7d59756ed313.jpg)
#### 第三步:在第三方开放平台配置通用链接
### 第三步:在第三方开放平台配置通用链接
##### 微信
#### 微信
打开微信[开放平台](https://open.weixin.qq.com/),在“管理中心”页面的“移动应用”下找到已经申请的应用(没有申请应用请点击“创建移动应用”新建应用),点击“查看”打开应用详情页面。
在“开发信息”栏后点击修改,在“iOS应用”下的“Universal Links”项中配置应用的通用链接,如下图所示:
![](https://img-cdn-tc.dcloud.net.cn/uploads/article/20191008/e933f7ef8ff078bf05e28a24efee74bd.png)
##### QQ
#### QQ
打开QQ[开放平台](https://connect.qq.com/index.html),在“管理中心”页面的“移动应用”下找到已经申请的应用(没有申请应用请点击“创建移动应用”新建应用),点击“查看”打开应用详情页面。
在“开发信息”栏后点击修改,在“iOS应用”下的“Universal Links”项中配置应用的通用链接,如下图所示:
![](https://img-cdn-aliyun.dcloud.net.cn/client/ulink/QQ.jpeg)
* 注意:QQ开放平台在填写时 只需要填写到host,后边的path QQ会自动生成,比如 HBuilder中一键生成 ```https://static-fa42aa5f-xxxxxxx-xxxxxxxx.bspapp.com/qq_conn/11111233333/``` 只需要填写 ```https://static-fa42aa5f-xxxxxxx-xxxxxxxx.bspapp.com/```,具体请查看 [QQ 填写及校验universallinks](https://wiki.connect.qq.com/%E5%A1%AB%E5%86%99%E5%8F%8A%E6%A0%A1%E9%AA%8Cuniversallinks)
##### 微博
#### 微博
打开微博[开放平台](https://open.weibo.com/),在“我的应用”下找到已经申请的应用,点击“查看”打开应用详情页面。
在“应用信息”栏后点击修改,在“iOS应用”下的“Universal Links”项中配置应用的通用链接,如下图所示:![](https://img-cdn-aliyun.dcloud.net.cn/client/ulink/weibo.jpeg)
至此,就已经完成了通用链接的配置全过程,云打包后生效。
#### 其他相关
### 其他相关
##### 客户端处理通用链接。
#### 客户端处理通用链接。
可通过5+ API的plus.runtime.launcher判断应用启动来源,如果其值为"uniLink"则表示通过通用链接启动应。这时可通过5+ API的plus.runtime.arguments获取启动参数,通用链接启动的情况将返回完整的通用链接地址。
例:HBuilderX中自带的默认真机运行基座HBuilderX注册的通用链接:[https://demo.dcloud.net.cn/ulink/](https://demo.dcloud.net.cn/ulink/)
##### 通用链接生成原理:
#### 通用链接生成原理:
1. 选择云空间获取云空间的默认/自定义域名
2. 按提前制定的规范(uni-universallinks/DCloud appid)拼接URL
3. 根据现有参数自动生成通用链接相关参数到manifest.json
4. 发起云打包时读取证书的profile文件生成apple-app-site-association并部署到前面选定的云空间根目录的.well-known目录下(请勿删除该文件,否则通用链接将失效)
###### 注意事项:
##### 注意事项:
* 通用链接指向的路径可以为空,他只是一种信息传递方式。可以简单地理解为:通过解析URL的“/”后的参数到apple-app-site-association中找到指定的包名并唤醒对应的APP
* 通用链接内容保存在manifest.json中"云打包后生效",被手机读取的时机是应用被安装的时候。如果你的通用链接内容有变化,你需要重新提交云打包,并重新安装一次应用才能生效
......@@ -98,7 +98,7 @@ HBuilderX (3.2.0 版本起) 新增QQ互联和新浪微博开放平台的通用
> 如果你是本地离线打包或者由于某种原因你需要用传统的方式:私有化部署服务器来托管apple-app-site-association文件创建通用链接。你仍然可以通过手动配置manifest.json实现。详情:[https://ask.dcloud.net.cn/article/36393#unilink](https://ask.dcloud.net.cn/article/36393#unilink)
##### 常见问题
#### 常见问题
1.为什么我打开通用链接提示:`The requested file was not found on this server.`
......
#### voice
### voice
voice 包括语言识别和语音朗读两部分。
......
#### uni.navigateTo(OBJECT)
### uni.navigateTo(OBJECT)
保留当前页面,跳转到应用内的某个页面,使用```uni.navigateBack```可以返回到原页面。
......@@ -98,7 +98,7 @@ onLoad: function (option) {
* 路由API的目标页面必须是在pages.json里注册的vue页面。如果想打开web url,在App平台可以使用 [plus.runtime.openURL](http://www.html5plus.org/doc/zh_cn/runtime.html#plus.runtime.openURL)或web-view组件;H5平台使用 window.open;小程序平台使用web-view组件(url需在小程序的联网白名单中)。在hello uni-app中有个组件ulink.vue已对多端进行封装,可参考。
* APP-NVUE平台暂不支持以`this.getOpenerEventChannel()`方式获取`eventChannel`,请换用`this.$scope.eventChannel`来获取,具体方式请参考上述示例。
#### uni.redirectTo(OBJECT)
### uni.redirectTo(OBJECT)
关闭当前页面,跳转到应用内的某个页面。
......@@ -123,7 +123,7 @@ uni.redirectTo({
* 跳转到 tabBar 页面只能使用 switchTab 跳转
#### uni.reLaunch(OBJECT)
### uni.reLaunch(OBJECT)
关闭所有页面,打开到应用内的某个页面。
......@@ -158,7 +158,7 @@ Tips:
* H5端调用`uni.reLaunch`之后之前页面栈会销毁,但是无法清空浏览器之前的历史记录,此时`navigateBack`不能返回,如果存在历史记录的话点击浏览器的返回按钮或者调用`history.back()`仍然可以导航到浏览器的其他历史记录。
#### uni.switchTab(OBJECT)
### uni.switchTab(OBJECT)
跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。
......@@ -197,7 +197,7 @@ uni.switchTab({
});
```
#### uni.navigateBack(OBJECT)
### uni.navigateBack(OBJECT)
关闭当前页面,返回上一页面或多级页面。可通过 ```getCurrentPages()``` 获取当前的页面栈,决定需要返回几层。
......@@ -234,7 +234,7 @@ uni.navigateBack({
```
#### EventChannel@event-channel
### EventChannel@event-channel
2.8.9+ 支持
页面间事件通信通道
......@@ -308,12 +308,12 @@ Tips:
- 页面路由拦截和管理,插件市场有很多封装好的工具类,搜索[路由](https://ext.dcloud.net.cn/search?q=%E8%B7%AF%E7%94%B1)
#### 窗口动画@animation
### 窗口动画@animation
> 本API仅App支持。小程序自身不支持自定义动画。H5的窗体动画可使用常规单页动画处理方案,见[H5下单页动画示例](https://ext.dcloud.net.cn/plugin?id=659&tdsourcetag=s_pctim_aiomsg)
窗口的显示/关闭动画效果,支持在 API、组件、pages.json 中配置,优先级为:`API = 组件 > pages.json`
##### API
#### API
有效的路由 API
- navigateTo
......@@ -331,7 +331,7 @@ uni.navigateBack({
animationDuration: 200
});
```
##### 组件
#### 组件
open-type 有效值
- navigateTo
......@@ -341,7 +341,7 @@ open-type 有效值
<navigator animation-type="pop-in" animation-duration="300" url="../test/test">navigator</navigator>
<navigator animation-type="pop-out" animation-duration="300" open-type="navigateBack" >navigator</navigator>
```
##### pages.json
#### pages.json
pages.json 中配置的是窗口显示的动画
```javascript
"style": {
......
#### uni.setStorage(OBJECT) @setstorage
### uni.setStorage(OBJECT) @setstorage
将数据存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。
**OBJECT 参数说明**
......@@ -23,7 +23,7 @@ uni.setStorage({
});
```
#### uni.setStorageSync(KEY,DATA) @setStorageSync
### uni.setStorageSync(KEY,DATA) @setstoragesync
将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。
**参数说明**
......@@ -41,7 +41,7 @@ try {
}
```
#### uni.getStorage(OBJECT) @getStorage
### uni.getStorage(OBJECT) @getstorage
从本地缓存中异步获取指定 key 对应的内容。
**OBJECT 参数说明**
......@@ -70,7 +70,7 @@ uni.getStorage({
});
```
#### uni.getStorageSync(KEY) @getStorageSync
### uni.getStorageSync(KEY) @getstoragesync
从本地缓存中同步获取指定 key 对应的内容。
**参数说明**
......@@ -92,7 +92,7 @@ try {
}
```
#### uni.getStorageInfo(OBJECT) @getStorageInfo
### uni.getStorageInfo(OBJECT) @getstorageinfo
异步获取当前 storage 的相关信息。
**平台差异说明**
......@@ -129,7 +129,7 @@ uni.getStorageInfo({
});
```
#### uni.getStorageInfoSync() @getStorageInfoSync
### uni.getStorageInfoSync() @getstorageinfosync
同步获取当前 storage 的相关信息。
**平台差异说明**
......@@ -151,7 +151,7 @@ try {
}
```
#### uni.removeStorage(OBJECT)
### uni.removeStorage(OBJECT) @removestorage
从本地缓存中异步移除指定 key。
**OBJECT 参数说明**
......@@ -174,7 +174,7 @@ uni.removeStorage({
});
```
#### uni.removeStorageSync(KEY) @removeStorageSync
### uni.removeStorageSync(KEY) @removestoragesync
从本地缓存中同步移除指定 key。
**参数说明**
......@@ -193,7 +193,7 @@ try {
}
```
#### uni.clearStorage()
### uni.clearStorage()
清理本地数据缓存。
**示例**
......@@ -202,7 +202,7 @@ try {
uni.clearStorage();
```
#### uni.clearStorageSync()
### uni.clearStorageSync()
同步清理本地数据缓存。
**示例**
......
#### getMenuButtonBoundingClientRect()
### getMenuButtonBoundingClientRect()
在小程序平台,如果原生导航栏被隐藏,仍然在右上角会有一个悬浮按钮,微信下也被称为胶囊按钮。本API用于获取小程序下该菜单按钮的布局位置信息,方便开发者布局顶部内容时避开该按钮。
......
#### nextTick(function callback)
### nextTick(function callback)
在小程序自定义组件,如wxcomponents中使用。延迟一部分操作到下一个时间片再执行。(类似于 setTimeout) 。其他平台无此概念。
- 微信小程序:[规范详情](https://developers.weixin.qq.com/miniprogram/dev/api/wx.nextTick.html)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册