Skip to content

Form components

Form Components introductions

componentIntroductionsMinimum version
buttonButton.1.0.0
checkbox-groupMultiple selector, internally composed of multiplecheckbox.1.0.0
checkboxMulti-select items.1.0.0
formForm. That the user inside the component entersswitch input checkbox slider radio picker Submit.When you click form In the form form-type for submit of button Component, the value Value, you need to add the name To act as key。1.0.0
inputInput box.1.0.0
labelUsed to improve the usability of form components.Use the for attribute to find the corresponding id, or place the control under the label, which triggers the corresponding control when clicked. For takes precedence over internal controls, and the first control triggers by default when there are multiple controls inside. The controls you can bind to are:button, checkbox, radio, switch。1.0.0
pickerA rolling selector that pops up from the bottom.1.0.0
picker-viewEmbed the page's scroll selector. Which can only be placed picker-view-column Other nodes are not displayed.1.0.0
picker-view-columnScroll the selector subitems. Only can be placed on picker-viewThe height of its child nodes is automatically set to the same height as that of the child node in the picker-view is the same height as the checkbox1.0.0
radio-groupSingle selector, internally composed of multiple radio Composition.1.0.0
radioRadio item.1.0.0
sliderSlide the selectors.1.0.0
switchSwitch selector.1.0.0
textareaMultiline input box.1.0.0
editorRich text editor2.5.2
keyboard-accessorySet up input / textarea Focus above the keyboard cover-view / cover-image Toolbar view2.11.6

button

attributetypeDefault valueRequiredIntroductionsMinimum version
sizestringdefaultnoButton size1.0.0
typestringdefaultnoStyle type of on1.0.0
plainbooleanfalsenoWhether the on is hollow, the background color is transparent1.0.0
disabledbooleanfalsenoIs it disabled?1.0.0
loadingbooleanfalsenoDoes the name come with loading icon1.0.0
form-typestringnoUsed for form Component, click separately to trigger form Component submit/reset event1.0.0
open-typestringnoPhiz open ability2.12.11
hover-classstringbutton-hovernoSpecifies the style class for which the on is pressed. when hover-class="none" There is no click state effect2.11.4
hover-stop-propagationbooleanfalsenoSpecifies whether to prevent this node's ancestor from clicking2.11.4
hover-start-timenumber20noHow long does it take to click, in milliseconds?2.11.4
hover-stay-timenumber70noClick hold time after finger release, in milliseconds2.11.4
langstringennoSpecifies the language in which user information is returned, zh_CN Simplified Chinese, en_TW Traditional Chinese, en English.Not supported
session-fromstringnoSession source, open type = "contact"2.12.11
send-message-titlestringCurrent titlenoIn-session message card title, valid when opentype = "contact"2.12.11
send-message-pathCurrent sharing pathdefaultnoThe in-session message card is valid when it clicks the jump phizclip path, open-type = "contact"2.12.11
send-message-imgstringscreenshotnoPicture of in-session message card, valid when opentype = "contact"2.12.11
app-parameterstringnoopen APP When, to APP The parameter passed is valid when open-type = launchApp2.12.11
show-message-cardbooleanfalsenoWhether to display an in-session message card, set this parameter to True, users entering the customer service session will display "may want to send phizclip" prompt in the lower right corner, users can click on the phizclip can quickly send a message, open type = "contact" valid2.12.11
bindgetuserinfoeventhandlenoWhen the user clicks the on, the user information will be returned.[pz.getUserInfo]((pz.getUserInfo) returns consistent, open-type."getUserInfo" is valid2.12.11
bindcontacteventhandlenoCustomer service message callback, valid when opentype = "contact"Not supported
bindgetphonenumbereventhandlenoGets the user's phone number callback, valid when open-type = getPhoneNumber2.12.11
binderroreventhandlenoA bad callback occurs when using open capabilities. Valid when open-type = launchApp2.12.11
bindopensettingeventhandlenoCallback after opening the authorization settings page, open type = openSetting2.12.11
bindlaunchappeventhandlenoopen APP Successful callback, open type = launchApp2.12.11
bindchooseavatareventhandlenoopen APP Successful callback, open type = launchApp2.12.11
ValueIntroductionsMinimum version
defaultDefault Size
miniSmall size
ValueIntroductionsMinimum version
primarygreen
defaultwhite
warnred
ValueIntroductionsMinimum version
submitSubmit form
resetReset Form
ValueIntroductionsMinimum version
contactOpen the customer service session2.12.11
shareTrigger the user to forward2.12.11
getPhoneNumberGet the user's phone number, which can be obtained from the bind get phone number callback,explicit explanation2.12.11
getUserInfoGet user information, which you can get from the bind get userinfo callback2.12.11
launchAppOpen the app, you can set the parameters to the app through the app-parameter attributeexplicit explanation2.12.11
openSettingOpen Authorization Settings Page2.12.11
feedbackOpen the "feedback" page2.12.11
chooseAvatarGet the user avatar, you can get the avatar information in the bindchooseavatar callback2.12.11
ValueIntroductionsMinimum version
enEnglish
zh_CNSimplified Chinese
zh_TWTraditional Chinese

checkbox

attributetypeDefault valueRequiredIntroductionsMinimum version
colorstring#09BB07noCheck box color, same as css color1.0.0
valuestringnocheckbox, triggered when selectedcheckbox-group) change Event and carry checkbox of value2.11.4
disabledbooleanfalsenoIs it disabled?2.11.4
checkedbooleanfalsenoIs currently selected, can be used to set the default selection2.11.4

checkbox-group

attributetypeDefault valueRequiredIntroductionsMinimum version
bindchangeEventHandlenoTriggers when a check item changes in checkbox-group change Event, detail = {value:[Array of values for the selected checkbox]}2.11.4

editor

attributetypeDefault valueRequiredIntroductionsMinimum version
read-onlybooleanfalsenoSet the editor to read-only2.7.0
placeholderstringnoPrompt information2.7.0
show-img-sizebooleanfalsenoPrompt information2.7.0
show-img-toolbarbooleanfalsenoDisplay toolbar controls when clicking a picture2.7.0
show-img-resizebooleanfalsenoClick on the picture to show the change size control2.7.0
bindreadyeventhandlenoTriggered when editor initialization is complete2.7.0
bindfocuseventhandlenoTriggered when the editor is focused, event.detail = {html, text, delta}2.7.0
bindblureventhandlenoTriggered when the editor loses focus, event.detail = {html, text, delta}2.7.0
bindinputeventhandlenoTriggered when editor content changes, detail = {html, text, delta}2.7.0
bindstatuschangeeventhandlenoadopt Context Method to change a style in the editor, returning a style already set for the selection2.7.0

form

attributetypeDefault valueRequiredIntroductionsMinimum version
report-submitbooleanfalsenoWhether to return formId For sendingTemplate message1.0.0
bindsubmiteventhandlenocarry form Data triggering in submit Event, event.detail = {value : {'name': 'value'} , formId: ''}1.0.0
bindreseteventhandlenoTriggered when the form is reset reset event1.0.0
report-submit-timeoutnumber0noWait a period of time (milliseconds) to confirm formId Whether to take effect. If this parameter is not specified, formId There is a small probability that it will be invalid (as in the case of a network failure). Specifying this parameter will allow you to detect formId The time of this parameter is used as the timeout for this test. If it fails, returns requestFormId:fail Initial formIdNot supported

label

attributetypeDefault valueRequiredIntroductionsMinimum version
forstringnoBinding control id1.0.0

picker

attributetypeDefault valueRequiredIntroductionsMinimum version
modestringselectornoSelector type1.0.0
disabledbooleanfalsenoIs it disabled?1.0.0
confirm-colorstring#586c94noConfirm button text color1.0.0
cancel-colorstring#586c94noCancel button text color1.0.0
bindcanceleventhandlenoSelector Title, available for Android only
header-textstringnoSelector Title, available for Android onlyNot supported
ValueIntroductionsMinimum version
selectorCommon selector
multiSelectorMulti-column selector
timeTime selector
dateDate picker
regionProvincial urban selector

In addition to the general properties mentioned above, picker have different properties for different mode.

Multiple column selector: mode = multiSelector

attributetypeDefault valueRequiredIntroductionsMinimum version
rangearray/object array[]nomode for selector or multiSelector Range effective
range-keystringnowhen range It's a... Object Array When the range-key To specify Object in key Displays content as a selector
valuearray[]noIndicate that you have chosen range Whose subscript is derived from the 0 Start.)
bindchangeeventhandlenovalue Triggered when changed change Event, event.detail = {value}
bindcolumnchangeeventhandlenoTriggered when the column changes

Multiple column selector: mode = time

attributetypeDefault valueRequiredIntroductionsMinimum version
valuestringnoIndicates the selected time in the format "hh: mm"
startstringnoIndicates the selected time in the format "hh: mm"
endstringnoRepresents the end of a valid time range, with the string format "hh: mm"
bindchangeeventhandlenovalue Triggered when changed change Event, event.detail = {value}

Multiple column selector: mode = date

attributetypeDefault valueRequiredIntroductionsMinimum version
valuestringSame daynoRepresents the selected date in the format "YYYY-MM-DD"
startstringnoRepresents the start of a valid date range, with a string format of "YYY-YM-MD-DD"
endstringnoRepresents the end of a valid date range in the string format "YYY-MM-DD"
fieldsstringdaynoValid value Year, month, day, represents the granularity of the selector
bindchangeeventhandlenoValid value Year, month, day, represents the granularity of the selector

fields Valid value:*

ValueIntroductionsMinimum version
yearSelector granularity is year
monthSelector granularity is month
daySelector granularity is day

Multiple column selector: mode = region

attributetypeDefault valueRequiredIntroductionsMinimum version
valuearray[]noRepresents the selected province, with the first value in each column selected by default
custom-itemstringnoYou can add a custom item to the top of each column
levelstringnoregionSelector Hierarchy
bindchangeeventhandlenovalue Triggered when changed change Event, event.detail = {value, code, postcode}, where the fields code Is a statistical zoning code, postcode It's a zip code.

picker-view

attributetypeDefault valueRequiredIntroductionsMinimum version
valueArraynoThe numbers in the array are represented sequentially picker-view Inner picker-view-column Selected items (subscript from 0 Start), the number is greater than picker-view-column Optional length, select the last item.1.0.0
indicator-stylestringnoSet the style of the checkbox in the middle of the selector1.0.0
indicator-classstringnoSet the class name of the middle checkbox in the selector2.11.4
immediate-changebooleanfalsenoIf or not trigger the change event immediately when the finger is released. If not on, the change event will be triggered after the scrolling animation ends.Not supported
mask-stylestringnoSet the style of the mask2.11.4
mask-classstringnoSet the class name of the mask2.11.4
bindchangeeventhandlenoTriggers the change event when scrolling the selection, event.detail = {value}. Value is an array representing picker-view Inner picker-view-column Which item is currently selected (subscript from 0 Start.)2.11.4
bindpickstarteventhandlenoTrigger event when scroll selection starts2.11.4
bindpickendeventhandlenoTrigger event when scroll selection ends2.11.4

picker-view-column

Scroll selector subitem. It can only be placed in the picker-view, and the height of the child node is automatically set to the height of the selected box in the picker-view

radio

attributetypeDefault valueRequiredIntroductionsMinimum version
colorstring#09BB07noColor of radio, same as color of css1.0.0
valuestringnoradio Identification. Whenradio When selected,radio-group of change Events will carryradio value2.11.4
checkedbooleanfalsenoCurrently selected2.11.4
disabledbooleanfalsenoIs it disabled?2.11.4

radio-group

attributetypeDefault valueRequiredIntroductionsMinimum version
bindchangeEventHandlenoTriggered when the selected item in radio-group changes change Event, detail = {value:[Array of values for selected radio]}2.11.4

slider

attributetypeDefault valueRequiredIntroductionsMinimum version
minnumber0noleast value1.0.0
maxnumber100noMaximum value1.0.0
stepnumber1noStep size must be greater than 0 and can be(Max - Min) integer1.0.0
disabledbooleanfalsenoIs it disabled?1.0.0
valuenumber0noCurrent value1.0.0
colorcolor#e9e9e9noColor of the background bar use the backgroundColor)1.0.0
selected-colorcolor#1aad19noSelected color (use the activeColor)1.0.0
show-valuebooleanfalsenoDisplays current value1.0.0
bindchangeeventhandlenoEvent triggered after completing a drag, event.detail = {value}1.0.0
activeColorcolor#1aad19noSelected color2.11.4
backgroundColorcolor#e9e9e9noBackground Bar Color2.11.4
block-sizenumber28noThe size of the slider in the range 12 - 282.11.4
block-colorcolor#ffffffnoSlider color2.11.4
bindchangingeventhandlenoEvent triggered during drag, event.detail = {value}2.11.4

switch

attributetypeDefault valueRequiredIntroductionsMinimum version
checkedbooleanfalsenoIf selecteds1.0.0
disabledbooleanfalsenoIs it disabled?1.0.0
typestringswitchnoStyle, valid value: switch, checkbox1.0.0
colorstring#04BE02noswitch The color of css of color1.0.0
bindchangeeventhandlenochecked Triggered when changed change Events, event.detail = {value}1.0.0

input

attributetypeDefault valueRequiredIntroductionsMinimum version
valuestringyesThe initial content of the input box2.11.4
typestringtextnoinput Type2.11.4
passwordbooleanfalsenoIs it a password type?2.11.4
placeholderstringyesPlaceholder when input box is empty2.11.4
placeholder-stylestringyesDesignation placeholder Style2.11.4
placeholder-classstringinput-placeholdernoDesignation placeholder Style class2.11.4
disabledbooleanfalsenoIs it disabled?2.11.4
maxlengthnumber140noMaximum input length, set to -1 Does not limit the maximum length2.11.4
cursor-spacingnumber0noSpecifies the distance between the cursor and the keyboard input The distance from the bottom and cursor-spacing The minimum distance specified as the distance between the cursor and the keyboard
auto-focusbooleanfalseno(Soon to be abandoned, please use directly focus ) Auto focus, pull up the keyboard
focusbooleanfalsenoGetting focus
confirm-typestringdonenoSets the text of the on in the lower right corner of the keyboard, which takes effect only when type = 'text'
cursornumberyesSpecifies the cursor position when focusing
confirm-holdbooleanfalsenoClick on the on in the lower right corner of the keyboard to keep the keyboard is not folded
selection-startnumber-1noCursor starting position, valid for auto-aggregation, with selection-end
selection-endnumber-1noEnd of cursor position, valid for auto-aggregation, with selection-start
adjust-positionbooleantruenoDoes the page automatically push up when the keyboard bounces up
bindinputeventhandleyesTriggered when keyboard input, event.detail = {value, cursor, keyCode},keyCode Is the key value, 2.1.0 The handler function can directly return A string that replaces the contents of the input box.
bindfocuseventhandleyesTriggered when input box is focused, event.detail = { value, height },height For keyboard height, in the base library 1.9.90 Rise support
bindblureventhandleyesTriggered when the input box loses focus, event.detail = { value, encryptedValue, encryptError }
bindconfirmeventhandleyesTriggered when the Finish on is clicked, event.detail = { value }
bindkeyboardheightchangeeventhandleyesThis event is triggered when the keyboard height changes, event.detail = {height: height, duration: duration}
always-embedbooleanfalsenoforce input In the same tier state, default focus time input It cuts to the non-state. (Only in iOS Entry into force below)Not supported
hold-keyboardbooleanfalsenoDoes not close the keyboard when you click on the page
safe-password-cert-pathstringnoSecure keyboard encryption public key path, only support intra-package pathNot supported
safe-password-lengthnumbernoSafe keyboard input password lengthNot supported
safe-password-time-stampnumbernoNot supportedNot supported
safe-password-noncestringnoNot supportedNot supported
safe-password-saltstringnoThe security keyboard calculates the hash salt value, if custom-hash is specified Is invalidNot supported
safe-password-custom-hashstringnoThe security keyboard evaluates hash algorithmic expressions, such as md5(sha1('foo' + sha256(sm3(password + 'bar'))))`Not supported
valueIntroductionsMinimum version
textText input keyboard
numberDigital input keyboard
idcardID input keyboard
digitNumeric keypad with decimal point

Numeric keypad with decimal point

valueIntroductionsMinimum version
sendThe bottom right on is "send."
searchThe bottom right on is "Search."
nextThe bottom right on is "Next."
goThe on in the lower right corner is "Go."
doneThe bottom right on is "Done"

textarea

attributetypeDefault valueRequiredIntroductionsMinimum version
valuestringnoEnter the contents of the box
placeholderstringnoPlaceholder when input box is empty
placeholder-stylestringnoDesignation placeholder Currently supports only color, font-size, and font-weight
placeholder-classstringtextarea-placeholdernoDesignation placeholder Style class
disabledbooleanfalsenoDesignation placeholder Style class
maxlengthnumber140noMaximum input length, set to -1 Does not limit the maximum length
auto-focusbooleanfalsenoAutofocus, pull up the keyboard.
focusbooleanfalsenoAutofocus, pull up the keyboard.
auto-heightbooleanfalsenoAutofocus, pull up the keyboard.
fixedbooleanfalsenoif textarea It was in a place position:fixed The specified property needs to be displayed fixed for true
cursor-spacingnumber0noSpecifies the distance between the cursor and the keyboard. taketextareaThe distance from the bottom andcursor-spacingThe minimum distance specified as the distance between the cursor and the keyboard
cursornumber-1noSpecifies the cursor position when focusing
show-confirm-barbooleantruenoDisplay the bar above the keyboard with the "Finish" on
selection-startnumber-1noCursor starting position, valid for automatic aggregation, with theselection-endCollocation use
selection-endnumber-1noCursor end position, valid for automatic aggregation, with theselection-startCollocation use
adjust-positionbooleantruenoDoes the page automatically push up when the keyboard bounces up
hold-keyboardbooleanfalsenoDoes not close the keyboard when you click on the page
disable-default-paddingbooleanfalsenoDoes not close the keyboard when you click on the page
bindfocuseventhandlenoTriggered when input box is focused, event.detail = { value, height },height For keyboard height, in the base library 1.9.90 Rise support
bindblureventhandlenoTriggered when the input box loses focus, event.detail = {value, cursor}
bindlinechangeeventhandlenoCalled when the number of lines in the input box changes, event.detail = {height: 0, heightRpx: 0, lineCount: 0}
bindinputeventhandlenoWhen keyboard input, triggers input Event, event.detail = {value, cursor, keyCode},keyCode Is a key value and currently the tool does not support returning keyCode parameters.bindinput The return value of the handler is not reflected in the textarea on
bindconfirmeventhandlenoWhen the click is complete, trigger confirm Event, event.detail = {value: value}
bindkeyboardheightchangeeventhandlenoThis event is triggered when the keyboard height changes, event.detail = {height: height, duration: duration}

keyboard-accessory

tip: The maximum height of the view is 200px

Sample code

<textarea hold-keyboard="{{true}}">
  <keyboard-accessory class="container" style="height: 50px;">
    <cover-view bindtap="tap" style="flex: 1; background: green;">1</cover-view>
    <cover-view bindtap="tap" style="flex: 1; background: red;">2</cover-view>
  </keyboard-accessory>
</textarea>