8月第三週

8.18

will-change 屬性

The will-change CSS property provides a way for authors to hint browsers about the kind of changes to be expected on an element, so that the browser can set up appropriate optimizations ahead of time before the element is actually changed. These kind of optimizations can increase the responsiveness of a page by doing potentially expensive work ahead of time before they are actually required.

8.21

- 微信小程序中使用阿里矢量圖標

http://blog.csdn.net/mrhuangxiutao/article/details/72178445

- WebView渲染載體

- 微信小程序頁面傳值

-1- url + " " 傳參

用<nevigator>標籤傳遞
複雜類型的參數可以用JSON.Stringfy()轉化爲字符串傳遞

-2- 用getCurrentPages()獲取棧中全部頁面,然後把數據寫入相應界面

適合往已存在的頁面傳值

-3-寫入本地,可以跨頁面傳值

wx.setStorage/wx.getStorage
寫入本地的數據緩存可以分爲同步與異步兩種方式

-4-把數據聲明爲全局變量

var detail = getApp().detail;

8.22

- JS數組查重的方法

- 微信小程序定位到當前城市

- 幾種響應式佈局

-1-響應式佈局

寫多個樣式表文件,逐漸被淘汰

-2-rem佈局

通過rem把頁面等分,rem是相對於根路徑font-size尺寸的
所有想要適應不同頁面,只需改變font-size即可

-3-流式佈局

一般使用百分比或者flex 寬度永遠鋪滿頁面寬度,但高度和其他長度仍用px

-4-scale伸縮佈局

  • 通過js更改viewport的initial-scale
  • 直接寫死viewport
<meta name="viewport" content="width=360;user-scalable=no">

上面這行代碼的意思是一直用width=360的寬度處理這個頁面
(伸縮的問題在於不能顯式的設置minnum-scale=1.0,否則就達不到效果,而且這個值是觸發gpu raster的一個條件
gup raster?硬件加速)

-5-rpx佈局

系統級的rem,不用自己設置,1rpx=windows.innerWidth/750

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章