The style class the view that is tapped. When hoverClass="none", the tap state is not displayed.
hoverStopPropagation
Boolean
false
Specifies whether to block the tapped state from the ancestor node of this node.
hoverStartTime
Number
50
Specifies the time elapsed after tapping but before the tapped state occurs. It is measured in milliseconds.
hoverStayTime
Number
400
Specifies the duration when the tapped state retains after stopping tapping. It is measured in milliseconds.
onClick
Event handler
A click event triggered.
onLongPress
Event handler
The finger leaves the screen after it taps and holds on the screen for more than 350 ms. If an event callback function is specified and this event is triggered, the click event is not triggered.
Specifies the location of the vertical scroll bar.
scrollLeft
Number, String
No
Specifies the location of the horizontal scroll bar.
scrollIntoView
String
No
Specifies the direction to which the scroll bar can be moved. Its value should be the ID of a child element (the ID cannot begin with a number), and this child element is scrolled in the direction specified in this property.
onScrollToUpper
Event handler
No
Triggered when the scroll bar is moved to the top or left side. event.detail = { direction }
onScrollToLower
Event handler
No
Triggered when the scroll bar is moved to the bottom or right side. event.detail = { direction }
onScroll
Event handler
No
Triggered when the scroll bar is moving. event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}
upperThreshold
Number, String
50
No
Specifies the distance from the top/left of the page when a scrolltoupper event is triggered.
lowerThreshold
Number, String
50
No
Specifies the distance from the bottom/right of the page when a scrolltoupper event is triggered.
fastDeceleration
boolean
false
use fast rate of deceleration after the user lifts their finger. (only work with enhanced: true and only work on iOS)
tip: If in bindchange In the event callback function of setData change current Value, it is possible to cause setData Is constantly called, so usually please change current Prevalue detection source Field to determine if it was caused by user touch.
The color of the icon. It is the same as the color of the css.
type Type=|'circle'|'download'|'info'|'safe-success'|'safe-warn'|'success'|'success-circle'|'success-no-circle'|'waiting'|'waiting-circle'|'warn'|'info-circle'|'cancel'|'search'|'clear'|'back'|'delete'|'success-no-circle-thin'|'arrow'|'arrow-bold'|'back-arrow'|'back-arrow-thin'|'close'|'close-thin'|'back-circle'
BMP use base64 (background-image: url(data:image/svg+xml,..);) internally.
Currently, two nodes are supported, which are distinguished according to the type: element node and text node. It is the element node by default. HTML nodes are displayed in the rich text area.
Specifies whether the input is password-type content.
placeholder
String
The placeholder used when the input box is empty.
placeholderStyle
String
Specifies the style of the placeholder.
placeholderClass
String
input-placeholder
Specifies the style class of the placeholder.
disabled
Boolean
false
Specifies whether to disable the component.
maxlength
Number
140
The maximum length. When it is set to -1, the maximum length is not limited.
cursorSpacing
Number
0
Specifies the distance between the cursor and the keyboard. It is either the distance between the input box and the bottom of the screen or the distance specified via cursorSpacing, whichever is smaller..
autoFocus
Boolean
false
(Will be discarded soon. Use the focus instead.) Auto focus. The keyboard is automatically displayed.
focus
Boolean
false
Gets focus.
confirmType
String
done
Sets the text on the lower-right button on the keyboard. It takes effect only when type='text'.
confirmHold
Boolean
false
Specifies whether the keyboard is not hidden when the lower-right button on the keyboard is tapped.
cursor
Number
Specifies the cursor position during focusing.
selectionStart
Number
-1
The start position of the cursor. It takes effect only during auto focusing, and needs to used with selection-end.
selectionEnd
Number
-1
The end position of the cursor. It takes effect only during auto focusing, and needs to used with selection-start.
adjustPosition
Boolean
true
Specifies whether to automatically push up the page when the keyboard is displayed.
holdKeyboard
Boolean
false
Specifies whether to hide the keyboard when clicking page while the input is focused.
onInput
Event handler
Triggered when the user taps the keyboard. event.detail = { value, cursor, keyCode }, where keyCode is the key value.box.
onFocus
Event handler
Triggered when the input box is focused. event.detail = { value, height }, where height is the height of the keyboard.
onBlur
Event handler
Triggered when the input box is unfocused. event.detail = { value }.
onConfirm
Event handler
Triggered when the Done button is tapped. event.detail = { value }.
onKeyboardHeightChange
Event handler
Triggered when the height of the keyboard changes. event.detail = { height, duration}.
Specifies the style of the placeholder. Only color, font-size, and font-weight styles are supported.
placeholderClass
String
textarea-placeholder
Specifies the style class of the placeholder.
disabled
Boolean
false
Specifies whether to disable the component.
maxlength
Number
140
The maximum length. When it is set to -1, the maximum length is not limited.
autoFocus
Boolean
false
(Will be discarded soon. Use the focus instead.) Auto focus. The keyboard is automatically displayed.
focus
Boolean
false
Gets focus.
autoHeight
Boolean
false
Specifies whether the height automatically increases. If this property is specified, style.height does not take effect.
fixed
Boolean
false
If the textarea is in an area of position:fixed, the value of the specified property should always be true.
cursorSpacing
Number
0
Specifies the distance between the cursor and the keyboard. It is either the distance between textarea and the bottom of the screen or the distance specified via cursorSpacing, whichever is smaller.
cursor
Number
-1
Specifies the cursor position during focusing.
showConfirmBar
Boolean
true
Specifies whether to display the bar containing the Done button above the keyboard.
selectionStart
Number
-1
The start position of the cursor. It takes effect only during auto focusing, and needs to used with selection-end.
selectionEnd
Number
-1
The end position of the cursor. It takes effect only during auto focusing, and needs to used with selection-start.
adjustPosition
Boolean
true
Specifies whether to automatically push up the page when the keyboard is displayed.
holdKeyboard
Boolean
false
Specifies whether to hide the keyboard when clicking page while the input is focused.
disableDefaultPadding
Boolean
false
Specifies whether to remove the default padding behavior on iOS.
confirmType
String
return
Sets the text on the lower-right button on the keyboard. It takes effect only when type='text'.
confirmHold
Boolean
false
Specifies whether the keyboard is not hidden when the lower-right button on the keyboard is tapped.
onInput
Event handler
Triggered when the user taps the keyboard. event.detail = { value, cursor, keyCode }, where keyCode is the key value.box.
onFocus
Event handler
Triggered when the input box is focused. event.detail = { value, height }
onBlur
Event handler
Triggered when the input box is unfocused. event.detail = { value, cursor }.
onLineChange
Event handler
Called when the number of lines in the input box changes. event.detail = { height: number, heightRpx: number, lineCount: number }
onConfirm
Event handler
Triggered when the Done button is tapped. event.detail = { value }.
onKeyboardHeightChange
Event handler
Triggered when the height of the keyboard changes. event.detail = { height, duration}.
Specifies the target to be redirected from. It is the current Mini Program by default.
url
String
The redirection link in the current Mini Program.
appId
String
The appId of the Mini Program to be opened. It is valid when target="miniProgram".
path
String
The path of the page to be opened. It is valid when target="miniProgram". If the value is empty, the homepage is opened.
extraData
object
The data to be passed to the target Mini Program. It is valid when target="miniProgram". The target Mini Program can obtain this data from App.onLaunch() and App.onShow().
version
'preview', 'experience', 'published'
published
The channel of the Mini Program to be opened. It is valid when target="miniProgram".
type
'app', 'web', 'webview'
app
The type of the Mini Program to be opened. It is valid when target="miniProgram".
rev
String
The rev of the Mini Program to be opened. It is valid when target="miniProgram".
onSuccess
Event handler
The callback function for a successful API call.
onFail
Event
The callback function for a failed API call.
onComplete
Event
The callback function used when the API call completed (always executed whether the call succeeds or fails).
It is recommended to use numeric values for width and height instead of auto or *%.
Before version 4.0.0, if the mode attribute is used and the value is not scaleToFill, it will be rendered with background-image; otherwise, it will be rendered with the <img /> tag.
If the value of src is a http resource, BMP will use mpService.downloadFile(src) to download image.
The image reuqests from <Image /> will have header: Referer: https://servicesbinance.com/${mp-app-id}/${mp-app-version}
Zoom mode, which scales the image without maintaining the aspect ratio, so that the width and height of the image are completely stretched to fill the image element.
aspectFit
Zoom mode, which maintains the aspect ratio and zooms the image so that the long side of the image is fully displayed. That is, the picture can be displayed completely.
aspectFill
Zoom mode, which maintains the aspect ratio and zooms the image, only ensuring that the short side of the image can be fully displayed. That is, the picture is usually only complete in the horizontal or vertical direction, the other direction will be cropped.
widthFix
Zoom mode, the width remains unchanged, the height changes automatically, and the aspect ratio of the original image remains unchanged
heightFix
Zoom mode, the height does not change, the width changes automatically, and the aspect ratio of the original image remains unchanged
top
Crop mode, do not scale the picture, only show the top area of the picture
bottom
Crop mode, do not zoom the picture, only show the bottom area of the picture
center
Crop mode, do not zoom the picture, only show the middle area of the picture
left
Crop mode, do not zoom the picture, only display the left area of the picture
right
Crop mode, do not zoom the picture, only display the right area of the picture
top left
Crop mode, do not zoom the picture, only display the upper left area of the picture
top right
Crop mode, do not zoom the picture, only display the upper right area of the picture
bottom left
Crop mode, do not zoom the picture, only display the lower left area of the picture
bottom right
Crop mode, do not zoom the picture, only display the lower right area of the picture
Disables screen scrolling and swipe-down-to-refresh features when the a finger taps to move on the canvas and a gesture event is bound.
onTouchStart
Event handler
No
Finger touch starts.
onTouchMove
Event handler
No
Finger moves after touch.
onTouchEnd
Event handler
No
Finger touch ends.
onTouchCancel
Event handler
No
Finger touch is interrupted by call reminder, pop-up window, etc.
onLongTap
Event handler
No
Triggered when a finger taps and holds on the screen for 500 ms. After this event is triggered, moving on the screen does not trigger screen scrolling.
And it is recommended that developers put the webview-sdk file on their own CDN so that they can provide users with a uniform and controlled speed experience.
web-view page code:
<scriptsrc="https://public.bnbstatic.com/static/js/mp-webview-sdk/webview-v1.0.1.min.js"></script><script>// PostMessage from web page to mini-program bn.miniProgram.postMessage({ foo:'bar'})// Receive messages from mini-program. bn.onMessage=function(e){console.log(e)// { data: 'baz' }}</script>