Appearance
Interface
interactive
showToast
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
showToast(Object object)
Display Message Prompt Box
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
title | string | yes | Content of the prompt | |
icon | string | 'success' | no | icon |
image | string | no | Custom icon local path, image Has a higher priority than icon | |
duration | number | 1500 | no | Prompt delay time |
mask | boolean | false | no | Whether to display transparent mask to prevent touch penetration |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.icon Legal value
value | Introductions |
---|---|
success | Display success icon, at this time title Text max display 7 Length of Chinese characters |
loading | Display the load icon, at this time title Text max display 7 Length of Chinese characters |
error | Displays the failure icon, at which point title Text max display 7 Length of Chinese characters |
none | Does not display icons, at this time title Up to two lines of text, 1.9.0 and above support |
sample code
javascript
ft.showToast({
title: 'Success',
icon: 'success',
duration: 2000
})
Be careful
ft.showLoading
andft.showToast
Can only display one at a timeft.showToast
Shouldft.hideToast
Paired use
showModal
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
showModal(Object object)
Display modal dialog box
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
title | string | no | Title of Tip | |
content | string | no | Content of the prompt | |
showCancel | boolean | true | no | Show Cancel Button |
cancelText | string | cancel | no | Cancel on text, up to 4 Character |
cancelColor | string | #000000 | no | The text color of the cancel on must be 16 Color strings in binary format |
confirmText | string | determine | no | Confirm on text, up 4 Character |
confirmColor | string | #初始值 | no | Confirm on text color, must be 16 Color strings in binary format |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.success callback
parameter
Object res
attribute | type | Introductions |
---|---|---|
confirm | boolean | for true When the user clicks the OK on |
cancel | boolean | for true Indicates that the user has clicked cancel for the Android The system distinguishes between clicking the mask to close or clicking the cancel on to close.) |
sample code
javascript
ft.showModal({
title: "Hint"?
content: 'This is a modal pop-up. '
success (res) {
if (res.confirm) {
console.log("User clicks OK.")
} else if (res.cancel) {
console.log('User clicks to cancel '-)
}
}
})
showLoading
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
showLoading(Object object)
display loading Cue box. Active call wx.hideLoading To close the prompt
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
title | string | yes | Content of the prompt | |
mask | boolean | false | no | Whether to display transparent mask to prevent touch penetration |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
ft.showLoading({
title: 'Loading',
})
setTimeout(function () {
ft.hideLoading()
}, 2000)
Be careful
ft.showLoading
andft.showToast
Can only display one at a timeft.showLoading
Shouldft.hideLoading
Paired use
showActionSheet
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
showActionSheet(Object object)
Display Action Menu
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
itemList | Array.<string> | yes | An array of text for ons whose maximum length is 6 | |
itemColor | string | #000000 | no | Button text color |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.success callback
parameter
Object res
attribute | type | Introductions |
---|---|---|
tapIndex | number | Number of ons the user clicks, from top to bottom, starting with 0 |
sample code
javascript
ft.showActionSheet({
itemList: ['A', 'B', 'C'],
success(res) {
console.log(res.tapIndex)
},
fail(res) {
console.log(res.errMsg)
}
})
hideToast
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
hideToast(Object object)
Hide message prompt box
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
hideLoading
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
hideLoading(Object object)
hide loading Prompt box
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
enableAlertBeforeUnload
Base library support from 2.11.5, iOS version 2.35.1, Android version 2.35.1
enableAlertBeforeUnload(Object object)
Open the Mini Program page to return to the inquiry dialog
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
message | string | yes | Interface calls the successful callback function | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
disableAlertBeforeUnload
Base library support from 2.11.5, iOS version 2.35.1, Android version 2.35.1
disableAlertBeforeUnload(Object object)
Close the Mini Program page and return to the query dialog
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
Navigation bar
showNavigationBarLoading
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
showNavigationBarLoading(Object object)
Show navigation bar loading animation on current page
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
setNavigationBarTitle
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
setNavigationBarTitle(Object object)
Dynamically set the title of the current page
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
title | string | yes | Page Title | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
ft.setNavigationBarTitle({
title: 'Current page'
})
setNavigationBarColor
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
setNavigationBarColor(Object object)
Set the page navigation bar color
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
frontColor | string | yes | Foreground color values, including the color of the on, title, and status bar, are supported only #ffffff and #000000 | |
backgroundColor | string | yes | Background color value, valid value is hexadecimal color | |
animation | Object | no | Animation effect | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.animation Structure
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
duration | number | 0 | no | Animation change time, unit ms |
timingFunc | string | 'linear' | no | Animation change mode |
object.animation.timingFunc Legal value
value | Introductions |
---|---|
'linear' | Animation moves at the same speed from start to finish |
'easeIn' | Animation begins at low speed |
'easeOut' | Animation ends at low speed |
'easeInOut' | Animation starts and ends at low speeds |
sample code
javascript
ft.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
hideNavigationBarLoading
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
hideNavigationBarLoading(Object object)
Hide navigation bar on current page Load animation
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
背景
setBackgroundTextStyle
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
ft.setBackgroundTextStyle(Object object)
Dynamically set drop-down background font, loading Style of Graph
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
textStyle | string | yes | Drop Down Background Font, Loading The style of the diagram. | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.textStyle Legal value
value | Introductions |
---|---|
dark | dark style |
light | light style |
sample code
javascript
ft.setBackgroundTextStyle({
textStyle: 'dark' // Drop Down Background Font, Loading The style of the diagram is dark
})
setBackgroundColor
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
ft.setBackgroundColor(Object object)
Dynamically set the background color of the window
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
backgroundColor | string | no | The background color of the window must be hexadecimal color value | |
backgroundColorTop | string | no | The background color of the top window must be a hexadecimal color value, and only iOS Support | |
backgroundColorBottom | string | no | The background color of the bottom window must be a hexadecimal color value, and only iOS Support | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
ft.setBackgroundColor({
backgroundColor: '#ffffff', // The background color of the window is white
})
ft.setBackgroundColor({
backgroundColorTop: '#ffffff', // The background color of the top window is white
backgroundColorBottom: '#ffffff', // The background color of the bottom window is white
})
Tab Bar
showTabBarRedDot
ft.showTabBarRedDot(Object object)
display tabBar The red dot in the upper right corner of an item
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | yes | tabBar Which one of those? From the left. | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
showTabBar
ft.showTabBar(Object object)
display tabBar
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
animation | boolean | false | no | Do you need animation effects? |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
setTabBarStyle
ft.setTabBarStyle(Object object)
Dynamic settings tabBar Overall style
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
color | string | no | tab Default color for text on HexColor | |
selectedColor | string | no | tab Color of text selected on the HexColor | |
backgroundColor | string | no | tab The background color of HexColor | |
borderStyle | string | no | The color of the top border of the tab bar, Support only black/white | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
js
ft.setTabBarStyle({
color: '#FF0000',
selectedColor: '#00FF00',
backgroundColor: '#0000FF',
borderStyle: 'white'
})
setTabBarItem
ft.setTabBarItem(Object object)
Dynamic settings tabBar The content of an item,2.7.0
Temporary files and network files are supported
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | yes | tabBar Which one of those? From the left. | |
text | string | no | tab Button text on the | |
iconPath | string | no | Picture path, icon Size limit is 40kb, recommended size 81px * 81px, when postion for top This parameter is invalid when | |
selectedIconPath | string | no | Image path when selected, icon Size limit is 40kb, recommended size 81px * 81px When postion for top This parameter is invalid when | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
js
ft.setTabBarItem({
index: 0,
text: 'text',
iconPath: '/path/to/iconPath',
selectedIconPath: '/path/to/selectedIconPath'
})
setTabBarBadge
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
for tabBar Add text to the top right corner of an item
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | no | tabBar Which one of those? From the left. | |
text | string | no | Text displayed, exceeding 4 Characters are displayed as ... | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
ft.setTabBarBadge({
index: 0,
text: '1'
})
removeTabBarBadge
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
to remove tabBar Text in the upper-right corner of an item
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | no | tabBar Which one of those? From the left. | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
hideTabBarRedDot
ft.hideTabBarRedDot(Object object)
hide tabBar The red dot in the upper right corner of an item
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
index | number | yes | tabBar Which one of those? From the left. | |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
hideTabBar
ft.hideTabBar(Object object)
hide tabBar
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
animation | boolean | false | no | Do you need animation effects? |
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
Typeface
loadFontFace
ft.loadFontFace(Object object)
Load network font dynamically. The file address must be of the download type. File addresses only in the https format are supported on iOS
Caution.
- The contet-type returned by the font file is referenced to font, parsing will fail if the format is incorrect.
- the font link must be yeshttps (ios does not support http)
- cors support must be enabled for font linking *.
- Faild to load font can be ignored in the tooltip
parameter
Object object
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
global | boolean | false | no | Whether global effect | 2.10.0 |
family | string | yes | Defined font name | ||
source | string | yes | Font resource address. Suggested formats are TTF and WOFF. WOFF2 is not compatible with lower versions of iOS | ||
desc | Object | no | Optional font descriptor | ||
scopes | Array | no | Font resource address. Suggested formats are TTF and WOFF. WOFF2 is not compatible with lower versions of iOS. | ||
success | function | no | Interface calls the successful callback function | ||
fail | function | no | Interface calls failed callback functions | ||
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.desc Structure
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
style | string | 'normal' | no | Font style. Values include normal, italic, and oblique |
weight | string | 'normal' | no | Font weight. Values include normal, bold, 100, 200, ...900 |
variant | string | 'normal' | no | Set the font display text for small capital letters. Values include normal, small-caps, and inherit |
Example |
object.success callback
parameter
Object res
attribute | type | Introductions |
---|---|---|
status | string | Loading font results |
object.fail callback
parameter
Object res
attribute | type | Introductions |
---|---|---|
status | string | Loading font results |
object.complete callback
parameter
Object res
attribute | type | Introductions |
---|---|---|
status | string | Loading font results |
sample code
js
ft.loadFontFace({
family: 'Bitstream Vera Serif Bold',
source: 'url("https://sungd.github.io/Pacifico.ttf")',
success: console.log
})
Pull down to refresh
startPullDownRefresh
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
startPullDownRefresh(Object object)
Start a drop-down refresh. Trigger pull down refresh animation after the call, the effect is consistent with user manual pulldown refresh
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
ft.startPullDownRefresh()
stopPullDownRefresh
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
stopPullDownRefresh(Object object)
Stops the current page drop-down refresh
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
success | function | no | Interface calls the successful callback function | |
fail | function | no | Interface calls failed callback functions | |
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
sample code
javascript
Page({
onPullDownRefresh() {
ft.stopPullDownRefresh()
}
})
Roll
pageScrollTo
ft.pageScrollTo(Object object)
Scroll the page to the target location, support selection and scrolling distance positioning in two ways
parameter
Object object
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
scrollTop | number | no | Scroll to the target location on the page, unit px | ||
duration | number | 300 | no | Length of scrolling animation, in units ms | |
selector | string | no | Selector | 2.7.3 | |
offsetTop | number | no | Offset distance, to be used with the selector parameter, scrolls to the position where the selector adds the offset distance, in px | 3.0.8 | |
success | function | no | Interface calls the successful callback function | ||
fail | function | no | Interface calls failed callback functions | ||
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
selector grammar
Selectors are similar to CSS But only the following syntax is supported.
- ID selector:#the-id
- Class selector (you can specify more than one in a row):. a-class.another-class
- Child element selector:. The-parent > .the-child
- Descendant selector:. The-ancester .the-descendant
- Descendant selector across custom components:. The-ancester >>> .the-descendant
- Union of multiple selectors:#a-node, .some-other-nodes
sample code
js
ft.pageScrollTo({
scrollTop: 0,
duration: 300
})
ScrollViewContext
Base library support from 3.0.45
scroll-view enhanced instance
sample code
javascript
// get ScrollViewContext
ft.createSelectorQuery()
.select('#scroll-view')
.node()
.exec((res) => {
const scrollViewContext = res[0].node;
})
ScrollViewContext properties
attribute | type | Introductions |
---|---|---|
scrollEnabled | boolean |
sample code
javascript
ft.createSelectorQuery()
.select('#scroll-view')
.node()
.exec((res) => {
const scrollViewContext = res[0].node;
scrollViewContext.scrollEnabled = false
})
ScrollViewContext method
scrollIntoView
scrollIntoView(String selector)
Scroll to the specified position
selector params
String selector
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
selector | string | yes | element selector | 3.0.45 |
sample code
javascript
ft.createSelectorQuery()
.select('#scroll-view')
.node()
.exec((res) => {
const scrollViewContext = res[0].node;
scrollViewContext.scrollIntoView('.some-class');
})
scrollTo
scrollTo(Object object)
Scroll to the specified position
selector params
Object object
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
top | number | no | distance from top | 3.0.45 | |
left | number | no | distance from left | 3.0.45 | |
velocity | number | no | initial speed(Not supported) | 3.0.45 | |
duration | number | 300 | no | scroll animation duration | 3.0.45 |
animated | boolean | false | no | enable scrolling animation | 3.0.45 |
sample code
javascript
ft.createSelectorQuery()
.select('#scroll-view')
.node()
.exec((res) => {
const scrollViewContext = res[0].node;
scrollViewContext.scrollTo({
top: 0,
duration: 400,
animated: false
});
})
animation
createAnimation
Animation ft.createAnimation(Object object)
Create an animation instance animationCall the methods of the instance to describe the animation. Finally, through the animation instance export Method to export animation data passed to the component animation Property
parameter
Object object
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
duration | number | 400 | no | Animation duration, unit ms |
timingFunction | string | 'linear' | no | Animation effect |
delay | number | 0 | no | Animation delay time, unit ms |
transformOrigin | string | '50% 50% 0' | no |
timingFunction Legal value
value | Introductions | Minimum version |
---|---|---|
'linear' | Animation moves at the same speed from start to finish | |
'ease' | Animation starts at low speed, then speeds up and slows down before ending | |
'ease-in' | Animation begins at low speed | |
'ease-in-out' | Animation starts and ends at low speeds | |
'ease-out' | Animation ends at low speed | |
'step-start' | The first frame of the animation jumps to the end state until the end | |
'step-end' | The animation stays in the start state until the last frame jumps to the end state |
Return value
Animation
Animation
Animation object
method
Array.<Object> Animation.export()
Export the animation queue.export Method clears up the previous animation after each callAnimation Animation.step(Object object)
Indicates that a set of animations is complete. You can call any number of animation methods in a group of animations, all animations in one group will start at the same time, one group of animation will be completed before the next group animationAnimation Animation.matrix()
with transform-function matrixAnimation Animation.matrix3d()
with transform-function matrix3dAnimation Animation.rotate(number angle)
Rotate one angle clockwise from the originAnimation Animation.rotate3d(number x, number y, number z, number angle)
from fixed The axis rotates one angle clockwiseAnimation Animation.rotateX(number angle)
from X The axis rotates one angle clockwiseAnimation Animation.rotateY(number angle)
from And The axis rotates one angle clockwiseAnimation Animation.rotateZ(number angle)
from With The axis rotates one angle clockwiseAnimation Animation.scale(number sx, number sy)
scalingAnimation Animation.scale3d(number sx, number sy, number sz)
scalingAnimation Animation.scaleX(number scale)
scaling X axisAnimation Animation.scaleY(number scale)
scaling Y axisAnimation Animation.scaleZ(number scale)
scaling Z axisAnimation Animation.skew(number ax, number ay)
Yes X、Y Tilt the axisAnimation Animation.skewX(number angle)
Yes X Tilt the axisAnimation Animation.skewY(number angle)
Yes Y Tilt the axisAnimation Animation.translate(number tx, number ty)
Translation transformationAnimation Animation.translate3d(number tx, number ty, number tz)
Yes xyz Coordinate translationAnimation Animation.translateX(number translation)
Yes X Axial translationAnimation Animation.translateY(number translation)
Yes Y Axial translationAnimation Animation.translateZ(number translation)
Yes Z Axial translationAnimation Animation.opacity(number value)
Set TransparencyAnimation Animation.backgroundColor(string value)
Set the background colorAnimation Animation.width(number|string value)
Set the widthAnimation Animation.height(number|string value)
Set HeightAnimation Animation.left(number|string value)
Set up left valueAnimation Animation.right(number|string value)
Set up right valueAnimation Animation.top(number|string value)
Set up top valueAnimation Animation.bottom(number|string value)
Set up bottom value
Custom components
nextTick
ft.nextTick(function callback)
Deferring some operations to the next slice of time. (similar to setTimeout)
parameter
function callback
Introductions
Because the custom component setData and triggerEvent Such interfaces are synchronous operations, when these interfaces are called consecutively, they are executed in a synchronous process, so if the logic is not appropriate, it may lead to errors.
An extreme case: when the parent component s setData That raises the Trigger Event, which causes the parent component to proceed once more SetData, with passing wx:if Statement can cause strange errors by uninstalling subcomponents, so you can use this interface to defer execution to the next time slice for logic that does not need to be completed in a synchronous process
sample code
js
Component({
doSth() {
this.setData({ number: 1 }) // Execute directly in the current synchronization process
ft.nextTick(() => {
this.setData({ number: 3 }) // After the current synchronization process ends, the next time slice executes
})
this.setData({ number: 2 }) // Execute directly in the current synchronization process
}
})
Menu
getMenuButtonBoundingClientRect
Base library support from 1.3.9, iOS version 2.1.23, Android version 2.1.38
Gets layout location information for the menu on the capsule on in the upper right corner. Coordinate information takes the upper-left corner of the screen as the origin
attribute | type | Introductions |
---|---|---|
width | number | width in px |
height | number | height, in px |
top | number | Coordinates of the upper bound, in px |
right | number | Coordinates of the right border, in px |
bottom | number | coordinates of the bottom border, in px |
left | number | Coordinates of the left border, in px |