当前位置:网站首页>Recent applet development records

Recent applet development records

2022-07-07 02:08:00 No social workers, I

It's all some js dependent .

<view wx:for="{ {[11,22,33,44]}}">{ {index}} cycles { {item}}</view>

=====================
<view style="width: 300px; height: 300px; background-color: aquamarine;"
  bindtap="onTap" data-title=" Ha ha ha "
>
  { {name}}
</view>

  onTap: function(res){
    var get = res.currentTarget.dataset.title
    console.log(get)
    this.setData({
      name:get
    })
    
=====================
view Chinese characters cannot wrap
style="word-break: break-all;"

=====================
Regular expressions
js The regular expression of matches are as follows
<ol>
<li ><a href="./qqyinliu.html" > Methods and techniques - QQ drainage </a></li>
</ol>
It doesn't match , Search for . Cannot match spaces and newlines .
In the following way
var pattern_url = /<ol>[\s\S]*<\/ol>/gm;
The analysis is as follows :
[\s\S]* It means completely universal ,\s It's blank , Including Spaces 、 Line break 、tab Indent, all the blanks , and \S Just the opposite , So one positive and one negative , It means all the characters .
“[ ]” Is a range descriptor .[] This symbol , Indicates that the single characters contained in it appear in unlimited order

=====================
Button text does not wrap
<button 
  style="
    padding-left: 10px;
    margin-left: 10px; 
    width:max-content ;" 
  open-type="contact" 
  bindcontact="handleContact">
  Have questions about the project ? Click feedback
</button>

=====================
rich-text Text can be copied

<rich-text class="text" nodes="{ {all_content}}" user-select="true">
</rich-text>
 

原网站

版权声明
本文为[No social workers, I]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061827056730.html