Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement textarea component by WeChat Mini Programs

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "how to achieve textarea components by WeChat Mini Programs". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this "how to achieve textarea components by WeChat Mini Programs" article can help you solve the problem.

Multiline input box

Attribute name type default value description valueString

Enter the contents of the box placeholderString

Placeholder placeholder-styleString when the input box is empty

Specify the style of placeholder placeholder-classStringtextarea-placeholder specifies whether the style class disabledBooleanfalse of placeholder disables the maximum input length of maxlengthNumber140, sets it to 0 without limiting the maximum length of auto-focusBooleanfalse auto focus, and pulls up the keyboard. There can only be one or set auto-focus attribute focusBooleanfalse to get focus (not supported by development tools) whether auto-heightBooleanfalse is automatically increased. When setting auto-height, style.height has no effect on bindfocusEventHandle.

Triggered when the input box is focused, event.detail = {value: value} bindblurEventHandle

Triggered when the input box loses focus, event.detail = {value: value} bindlinechangeEventHandle

Called when the number of rows in the input box changes, event.detail = {height: 0, heightRpx: 0, lineCount: 0}

Sample code:

Make the input box get focus / / textarea.jsPage ({data: {height: 20, focus: false}, bindButtonTap: function () {this.setData ({focus: true})}, bindTextAreaBlur: function (e) {console.log (e.detail.value)}})

Bug & Tipbug: Wechat version 6.3.30 Magneto textarea in list rendering, the position of the newly added textarea in autofocus is miscalculated tip: do not use the textarea component in scroll-view

This is the end of the introduction on "how WeChat Mini Programs implements the textarea component". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report