微信小程序

1.文本兩端對齊

text{
text-align:justify;
width:200rpx;//設置文本寬度
}
text::after{
    width:100%;
    display:inline-block;
    content:'';
}

2.view佈局

display:flex;git

  1. flex-direction 決定是橫向仍是縱向微信

    row               從左到右的水平方向爲主軸(默認值)
       row-reverse       從右到左的水平方向爲主軸
       column            從上到下的垂直方向爲主軸
       column-reverse    從下到上的垂直方向爲主軸
  2. justify-content 在橫向上作改變微信開發

    flex-start       主軸起點對齊(默認值)
       flex-end         主軸結束點對齊
       center           主軸中居中對齊
       space-between    兩端對齊
       space-around     元素之間等距離
  3. align-items 在縱向上作改變工具

    stretch          填充整個容器(默認值)
       flex-start       側軸的起點對齊
       flex-end         側軸的終點對齊
       center           側軸居中對齊
       baseline         以子元素的第一行文字對齊

3.text內容空格

<text decode="{{true}}" space="{{true}}">&nbsp;&nbsp;</text>

4.input爲數字鍵盤

定義type屬性值
number 數字鍵盤(無小數點)
idcard 數字鍵盤(無小數點,有x鍵)
digit 數字鍵盤(有小數點)佈局


5.自定義微信客服

<button open-type="contact" bindcontact="handleContact" id='contact' style='display:none;'></button> 
<label for='contact' class='btn'>聯繫賣家</label>

6.微信開發者工具新增iPhone4屏幕

圖片描述

相關文章
相關標籤/搜索