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 solve the problem of excessive textarea level in WeChat Mini Programs

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

Share

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

This article mainly explains "how to solve the problem of too high level of textarea in WeChat Mini Programs". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to solve the problem of high textarea level in WeChat Mini Programs".

Create a new textarea component to replace the native textarea and add code

{{txt = ='? Placeholder:txt}} export default {config: {usingComponents: {}}, behaviors: [], properties: {placeholder: {type: String, value:''}, maxlength: {type: Number, value: 128}, name: String, value: {type: String, value:''}}, data: {hide: true Txt:', focus: false}, ready () {if (this.data.value! ='') {this.setData ({txt: this.data.value})}}, methods: {onFocus () {this.setData ({hide: false, focus: true})}, onInput (e) {this.setData ({txt: e.detail.value})} OnBlur () {this.setData ({hide: true, focus: false})}}. Ui-textarea {position: relative! important .textarea.hidden {display: block! important; position: absolute! important; left:-999px; right:-999px; top: 0;} .textarea {width: 100%; box-sizing: border-box;} .text {height: 100%; padding: 6px 5px; font-size: 14px;} .placeholder {color: # 888;}}

Vue code, modify it according to your needs. Pay special attention to not using wx;if or hidden attributes. Wx:if is rendered frequently. Although it can be used, part of hidden will show bug, and [hidden] will make auto-height incorrect for the first time.

At this point, I believe you have a deeper understanding of "how to solve the problem of excessive textarea level in WeChat Mini Programs". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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