iosselect是個什么東西?
移動端瀏覽器對於select的展示樣式是不一致的,ios下是類似原生的picker,安卓下各瀏覽器展示各異,我們需要一個選擇器組件來統一各端下各種瀏覽器的展示。下面是它的一個截圖:
iosselect 項目地址:
文檔和demo可以訪問github:https://github.com/zhoushengmufc/iosselect
iosselect能做什么?
移動端開發中,經常遇到選擇器功能,常見的時間選擇,日期選擇,地區選擇,單列選擇。iosselect完美實現一個組件實現各種選擇器的功能。
先看demo:
一級級聯,銀行選擇
http://zhoushengfe.com/iosselect/demo/one/bank.html
二級級聯,三國殺將領組合選
http://zhoushengfe.com/iosselect/demo/two/sanguokill.html
三級級聯,省市區選擇
http://zhoushengfe.com/iosselect/demo/three/area.html
viewport縮放時處理方案
http://zhoushengfe.com/iosselect/demo/rem/bank.html
日期選擇器 三級聯動,通過方法獲取數據,並且有加載中效果
http://zhoushengfe.com/iosselect/demo/datepicker/date.html
日期時間選擇器,共五級,通過方法獲取數據
http://zhoushengfe.com/iosselect/demo/five/time.html
iosselect的優勢
iosselect接口豐富,適用於多類場景
可以定制依賴關系,規定各層級之間是否有關聯。
可以定制選擇層級,支持1-5層選擇。
可以定制各項高度,可以規定展示項數,默認展示7項。
移動端rem應用普遍,無論你是px還是rem,使用iosselect都完全不是問題。
可以提供靜態數據,也可以使用方法獲取數據,支持同步方法和異步方法。
iosselect基於iscroll5開發,除此外無任何依賴,所以無論你是react還是angular還是vue還是zepto jquey都不是問題。