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渲染載體
- 微信小程序頁面?zhèn)髦?/h2>
-1- url + " " 傳參
用<nevigator>標簽傳遞
復雜類型的參數(shù)可以用JSON.Stringfy()轉(zhuǎn)化為字符串傳遞
-2- 用getCurrentPages()獲取棧中全部頁面葱跋,然后把數(shù)據(jù)寫入相應界面
適合往已存在的頁面?zhèn)髦?/p>
-3-寫入本地剃氧,可以跨頁面?zhèn)髦?/h4>
wx.setStorage/wx.getStorage
寫入本地的數(shù)據(jù)緩存可以分為同步與異步兩種方式
-4-把數(shù)據(jù)聲明為全局變量
var detail = getApp().detail;
8.22
- JS數(shù)組查重的方法
- 微信小程序定位到當前城市
- 幾種響應式布局
-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的寬度處理這個頁面
(伸縮的問題在于不能顯式的設(shè)置minnum-scale=1.0词身,否則就達不到效果,而且這個值是觸發(fā)gpu raster的一個條件
gup raster妖碉?硬件加速)
-5-rpx布局
系統(tǒng)級的rem,不用自己設(shè)置芥被,1rpx=windows.innerWidth/750