功能:同步小程序流程
This commit is contained in:
@@ -55,8 +55,16 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
/**
|
||||
* Purpose: displayStyle supports navigation-bar.js by holding or executing the display style page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
displayStyle: ''
|
||||
},
|
||||
/**
|
||||
* Purpose: lifetimes supports navigation-bar.js by holding or executing the lifetimes page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
lifetimes: {
|
||||
attached() {
|
||||
const rect = wx.getMenuButtonBoundingClientRect()
|
||||
@@ -65,9 +73,25 @@ Component({
|
||||
const isDevtools = platform === 'devtools'
|
||||
const { windowWidth, safeArea: { top = 0, bottom = 0 } = {} } = wx.getWindowInfo() || wx.getSystemInfoSync()
|
||||
this.setData({
|
||||
/**
|
||||
* Purpose: ios supports navigation-bar.js by holding or executing the ios page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
ios: !isAndroid,
|
||||
/**
|
||||
* Purpose: innerPaddingRight supports navigation-bar.js by holding or executing the inner padding right page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
innerPaddingRight: `padding-right: ${windowWidth - rect.left}px`,
|
||||
/**
|
||||
* Purpose: leftWidth supports navigation-bar.js by holding or executing the left width page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
leftWidth: `width: ${windowWidth - rect.left}px`,
|
||||
/**
|
||||
* Purpose: safeAreaTop supports navigation-bar.js by holding or executing the safe area top page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
safeAreaTop: isDevtools || isAndroid ? `height: calc(var(--height) + ${top}px); padding-top: ${top}px` : ``
|
||||
})
|
||||
},
|
||||
@@ -94,6 +118,10 @@ Component({
|
||||
const pages = getCurrentPages()
|
||||
if (data.delta && pages.length > data.delta) {
|
||||
wx.navigateBack({
|
||||
/**
|
||||
* Purpose: delta supports navigation-bar.js by holding or executing the delta page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
delta: data.delta
|
||||
})
|
||||
return
|
||||
@@ -102,6 +130,10 @@ Component({
|
||||
},
|
||||
home() {
|
||||
wx.switchTab({
|
||||
/**
|
||||
* Purpose: url supports navigation-bar.js by holding or executing the url page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
url: '/pages/workbench/index'
|
||||
})
|
||||
this.triggerEvent('home', {}, {})
|
||||
|
||||
Reference in New Issue
Block a user