『壹』 reactjs-mobile常用組件
reactjs 網站建設中常用的組件,基本涵蓋了項目日常所需
griddle-react
react-bootstrap
react-cropper
core-js
Molar standard library for javaScript. Includes polyfills for ECMAScript 5, ECMAScript 6: promises, symbols, collections, iterators, typed arrays, ECMAScript 7+ proposals, setImmediate, etc
Material UI
superagent
restful-error-es6
browserify
react-select-popover
react-infinite-scroll
semantic-ui
react-date-range日期選擇
react-scroll 快速定位滾動
react-timer-mixin suer timer
react-autosuggest auto input
react-native-swiper輪播
react-split-container分割線拖拽
reactjs-iscroll下拉上拉刷新
react-hammerjs觸屏事件庫
react-emoji-react emoji表情庫
react-ace在線編輯器
react-highcharts highchart
react-dropzone 上傳
react-fileupload-progress文件上傳帶processor
react-fontawesome 字體icon庫
react-pdf pdf文檔操作
react-desktop桌面UI
react-intl Internationalize React apps
react-image-gallery圖片輪播
react-s-alert alert
react-event-calendar事件日歷
react-color-picker 顏色選擇器
react-lazy-load 延遲載入
react-tag-input tag input
revalidator格式驗證
react-bootstrap-daterangepicker時間范圍
react-transitive-number增減數
react-css-transition-replace動畫
react-images image list
react-clockwall 時間畫布
react-autobind fun auto bind
react-simple-markdown-editor markdown編輯
react-remarkable markdown 顯示
random-gem 隨機數
react-masonry-component 瀑布流
react-alap 高德地圖
react--map 網路地圖
react-swipeable-views views滑動
react-swipnable-tabs 可橫向滾動的tab
react-motion 動畫
react-image-fallback 圖片lazy載入
react-mobile-datepicker 滾動選擇時間
react-images 幻燈片燈箱
react-image-magnify 圖片細節放大
urlencode node encode編碼
react-mobile-datepicker 滾動選擇時間 年月日
react-mobile-datetimepicker滾動選擇時間 年月日時分
react-fastclick消除touch click 300ms延遲
react-sortable react-anything-sortable 拖動排序
/ 6-20補充 /
react-autosuggest 自動提示
react-image-crop 圖片裁剪
ua-device ua判斷系統及版本
react-debounce-input 輸入延遲,適合做autocomplete
react-big-calendar 基於fullcalendar的日程組件
^-^歡迎回復交流^-^
『貳』 js動態添加帶WdatePicker日期控制項的文本框
你看看這代碼可能有幫助 這是自己添加表單的<script language="javascript">
function creafrom(op){
var str=op.href;
var submitForm = document.createElement('FORM');
document.body.appendChild(submitForm);
submitForm.method = 'POST';
if(str.lastIndexOf('?')>=0){
submitForm.action=str.substring(0,str.indexOf('?'));
}else{
submitForm.action=str;
}
var name;
var value;
var temp='';
var newElement;
if(str.indexOf('?')>0){
for(var j=str.indexOf('?')+1;j<str.length;j++){
if(str.charAt(j)!='&'){
temp+=str.charAt(j);
}else{
newElement = document.createElement('input');
newElement.type = 'hidden';
submitForm.appendChild(newElement);
newElement.name =temp.substring(0,temp.indexOf('='));
newElement.value =temp.substring(temp.indexOf('=')+1);
temp='';
}
if(j==str.length-1){
newElement = document.createElement('input');
newElement.type ='hidden';
submitForm.appendChild(newElement);
newElement.name =temp.substring(0,temp.indexOf('='));
newElement.value =temp.substring(temp.indexOf('=')+1);
}
}
}
document.submitForm.submit();
return false;
}
</script>
『叄』 weui.js 中的picker組件怎麼配置標題嗎
distpicker.js怎麼獲燃模取選中的值 對象屬性設置分為兩個過程:先是皮敏緩對象名字標識的設拿則定,然後是對對象的基本屬性進行設置。首先是對象的名字標識設置
『肆』 uni-app使用Vue.js
說明 :uni-app基於 Vue 2.0 實現,開發者需注意Vue 1.0 -> 2.0 的使用差異,詳見 從 Vue 1.x 遷移 。
uni-app不僅支持應用生命周期和頁面生命周期,還支持 vue 實例的如下生命周期函數:
注意 :不要在選項屬性或回調上使用箭頭函數,比如 created: () => console.log(this.a) 或 vm.$watch('a', newValue => this.myMethod())。因為箭頭函數是和父級上下文綁定在一起的,this 不會是如你做預期的 Vue 實例,且 this.a 或 this.myMethod 也會是未定義的。
幾乎全支持 Vue官方文檔:模板語法 ,下面講下不支持的情況。
(1)不支持純HTML
uni-app的非H5端里所有的 BOM/DOM 都不能用,也就是說 v-html 指令不能用,可以使用 rich-text組件 代替。或者使用三方組件wxparse,在hello uni-app中有示例。
(2)不支持部分復雜的 JavaScript 渲染表達式
非H5端無法支持復雜的 JavaScript 表達式。目前可以使用的有 + - * % ?: ! == === > < [] .,剩下的還待完善。
(3)不支持過濾器
編譯到 App 和小程序平台時不支持使用過濾器凱殲,可以使用計算屬性(computed)提前計算出數據(如果是數組類型,就提前計算整個數組),用以代替過濾器。
備注 : 自HBuilderX 1.7.1起,在微信小程序平台支持使用過濾器。
data 必須聲明為返回一個初始數據對象的函數;否則頁面關閉時,數據不會自動銷毀,再次打開該頁面時,會顯示上次數據。
注意 :在微盯碼沖信模兆小程序端,uni-app 將數據綁定功能委託給Vue,開發者需按Vue 2.0的寫法實現數據綁定,不支持微信小程序的數據綁定寫法,故如下寫法不支持:
需修改為:
支持 Vue官方文檔:計算屬性 。
實現全局變數的方式需要遵循 Vue 單文件模式的開發規范。詳細參考: uni-app全局變數的幾種實現方式 。
非H5端不支持在 template 內使用 methods 中的函數。
備注 : 自HBuilderX 1.7.1起,在微信小程序平台支持支持在 template 內使用 methods 中的函數。
為節約性能,我們將 Class 與 Style 的表達式通過 compiler 硬編碼到 uni-app 中。
全支持 Vue官方文檔:條件渲染 。
全支持vue列表渲染 Vue官方文檔:列表渲染 。只是需要注意一點,嵌套列表渲染,必須指定不同的索引!需要填寫 :key="xx" 。
注意 :同級多個 v-for 時 key 的值是不允許重復的,key 的綁定是不支持表達式的,需要按照以下方式處理。
幾乎全支持 Vue官方文檔:事件處理器 。事件映射表如下所示:
注意 :
(1)事件映射表中沒有的原生事件也可以使用,例如map組件的regionchange 事件直接在組件上寫成 @regionchange,同時這個事件也非常特殊,它的 event type 有 begin 和 end 兩個,導致我們無法在handleProxy 中區分到底是什麼事件,所以你在監聽此類事件的時候同時監聽事件名和事件類型既 <map @regionchange="functionName" @end="functionName" @begin="functionName"><map>。
(2)為兼容各端,事件需使用 v-on 或 @ 的方式綁定,請勿使用小程序端的bind 和 catch 進行事件綁定。
(3)事件修飾符
(4)若需要禁止蒙版下的頁面滾動,可使用 @touchmove.stop.prevent="moveHandle",moveHandle 可以用來處理 touchmove 的事件,也可以是一個空函數。
(5)按鍵修飾符:uni-app運行在手機端,沒有鍵盤事件,所以不支持按鍵修飾符。
支持 Vue官方文檔:表單控制項綁定 。建議開發過程中直接使用 uni-app:表單組件 。用法示例:
(1)H5 的select 標簽用 picker 組件進行代替
(2)表單元素 radio 用 radio-group 組件進行代替
組件是整個 Vue.js 中最復雜的部分,支持 Vue官方文檔:組件 。有且只能使用單文件組件(.vue 組件)的形式進行支持。其他的諸如:動態組件,自定義 render ,和 <script type="text/x-template"> 字元串模版等非H5端都不支持。詳細的非H5端不支持列表:
(1)暫不支持在組件引用時,在組件上定義 click 等原生事件、v-show(可用 v-if 代替)和 class style 等樣式屬性(例:<card class="class-name"> </card> 樣式是不會生效的)。
Slot(scoped 暫時還沒做支持)
(2)動態組件
(3)非同步組件
(4)inline-template
(5)X-Templates
(6)keep-alive
(7)transition
(8)class
(9)style
(10)組件里使用 slot 嵌套的其他組件時不支持 v-for
uni-app提供了豐富的 UI組件 ,比如: picker , map 等,需要注意的是原生組件上的事件綁定,需要以 vue 的事件綁定語法來綁定,如 bindchange="eventName" 事件,需要寫成 @change="eventName" 。如:
uni-app 支持配置全局組件,需在 main.js 里進行全局注冊,注冊後就可在所有頁面里使用該組件。 注意 :Vue.component 的第一個參數必須是靜態的字元串。示例:
(1)main.js 里進行全局注冊
(2)index.vue 里可直接使用組件
在 uni-app 中以下這些作為保留關鍵字,不可作為組件名。
備注 :除以上列表中的名稱外,標準的 HTML 及 SVG 標簽名也不能作為組件名。
(1) 如何獲取上個頁面傳遞的數據
在 onLoad 里得到,onLoad 的參數是其他頁面打開當前頁面所傳遞的數據。
(2) 如何設置全局的數據和全局的方法
uni-app內置了 vuex ,在app里的使用,可參考 hello-uniapp 的 store/index.js 。
(3)如何捕獲 app 的 onError
由於 onError 並不是完整意義的生命周期,所以只提供一個捕獲錯誤的方法,在 app 的根組件上添加名為 onError 的回調函數即可。如下:
(4)組件屬性設置不生效解決辦法
當重復設置某些屬性為相同的值時,不會同步到view層。 例如:每次將scroll-view組件的scroll-top屬性值設置為0,只有第一次能順利返回頂部。 這和props的單向數據流特性有關,組件內部scroll-top的實際值改動後,其綁定的屬性並不會一同變化。解決辦法有兩種(以scroll-view組件為例):
備注 :第二種解決方式在某些組件可能造成抖動,推薦第一種解決方式。
『伍』 js datetimepicker控制項的時間選擇條怎麼設置
今天做日期控制項,需求要求設置一個時間范圍限制,選擇從今天開始的日期才可以選擇,今天以前都不可以選擇
主要體現在bootstrap-datetimepicker控制項下面的2個日期參數
weekStart:1,
startDate:newDate(日期),
引用的基礎庫有
<scripttype="text/javascript"src="./jquery/jquery-1.8.3.min.js"charset="UTF-8"></script>
<scripttype="text/javascript"src="./bootstrap/js/bootstrap.min.js"></script>
<scripttype="text/javascript"src="../js/bootstrap-datetimepicker.js"charset="UTF-8"></script>
<scripttype="text/javascript"src="../js/locales/bootstrap-datetimepicker.fr.js"charset="UTF-8"></script>
HTML代碼
復制代碼
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">timestart</label>
<divclass="input-groupdateform_date_startcol-md-3">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/>
</div>
復制代碼
JS代碼
復制代碼
varnewDate=newDate();
vart=newDate.toJSON();
$('.form_date_start').datetimepicker({
format:'yyyy-mm-dd',
language:'fr',
weekStart:1,
todayBtn:1,
autoclose:1,
todayHighlight:1,
startView:2,
minView:2,
forceParse:0,
weekStart:1,
startDate:newDate(t),
});
復制代碼附:精確到分的時間、年月日、時間、年月、月日、從今天開始、到今天結束
HTML
復制代碼
<divclass="container">
<formaction=""class="form-horizontal"role="form">
<fieldset>
<legend>Test</legend>
<divclass="form-group">
<labelfor="dtp_input1"class="col-md-2control-label">DateTimePicking</label>
<divclass="input-groupdateform_datetimecol-md-5">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-th"></span></span>
</div>
<inputtype="hidden"id="dtp_input1"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input2"class="col-md-2control-label">DatePicking</label>
<divclass="input-groupdateform_datecol-md-5">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-calendar"></span></span>
</div>
<inputtype="hidden"id="dtp_input2"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">TimePicking</label>
<divclass="input-groupdateform_timecol-md-5"data-date=""data-date-format="hh:ii"data-link-field="dtp_input3"data-link-format="hh:ii">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">monthPicking</label>
<divclass="input-groupdateform_monthcol-md-5">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">monthdatePicking</label>
<divclass="input-groupdateform_month_datecol-md-5">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">yearPicking</label>
<divclass="input-groupdateform_yearcol-md-5">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/><br/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">timestart</label>
<divclass="input-groupdateform_date_startcol-md-3">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/>
</div>
<divclass="form-group">
<labelfor="dtp_input3"class="col-md-2control-label">timeend</label>
<divclass="input-groupdateform_date_endcol-md-3">
<inputclass="form-control"size="16"type="text"value=""readonly>
<spanclass="input-group-addon"><spanclass="glyphiwww.meidiyazx.com/sitemap.xml"></span></span>
<spanclass="input-group-addon"><spanclass="glyphiconglyphicon-time"></span></span>
</div>
<inputtype="hidden"id="dtp_input3"value=""/>
</div>
</fieldset>
</form>
</div>
『陸』 Ant-design dataPicker組件所遇問題
1 datePicker所加的className 類名作用的范圍是輸入框,不能控制展開的下拉框樣式
2 展開的日歷框的位置是相對於body,並不在 <div id='root'>中,而且層級較高,為1050,超過了Modal組件的層級,官方提供的dropdownClassName 屬性並不能加上類名,需簡雀用popupStyle加在DatePicker 上,可通過這種方法來解決層級過高的問題。
3 Mode屬性為year/mode 不能選中
4 結合mode屬性,Modal組件也是相對的body的組件,不在root范圍內,層級為1000,層級模咐中問題可通過 wrapClassName 屬性解決 ,但是如果多個modal覆蓋出現,或modal中datePicker,也會出現層旦山級問題,這時可以單個設置,也可以根據業務利用js直接提高 ,我在項目中有一個彈框是一定要顯示在最上面,因此用的js控制。
5.antd所增加的類名都會帶有後綴,如果只是更改css沒有影響,如果想利用js去控制css,需查詢DOM去獲取到真是的類名
『柒』 微信小程序自定義picker年月日時分秒選擇器組件
功能:
年月日時分秒,固定選擇范圍
效果:
自定義組件實現:
utils/datePicker.js
定義組件components/datePicker/datePicker.js
components/datePicker/datePicker.wxml
components/datePicker/datePicker.wxss
使用datePicker組件
index.json
index.wxml
index.js
『捌』 picker-extend 移動端級聯選擇插件
<h1 align="center" >picker-extend.js</h1>
一款多轎棚頃功能的移動端滾動選擇器,支持單選到多選、支持多級級聯、提供自定義回調函數、提供update函數二次渲染、重定位函數、兼容pc端拖拽等等..
picker-extend 移動端級聯選擇插件()
picker-extend 移動端級聯選擇插件(掘金)
picker-extend 移動端級聯選擇插件 (npm)
在你的js文件中import:
[圖片上傳失敗...(image-6fbf94-1536046640642)]
基礎實例 → 功能函數操作後
[圖片上傳失敗...(image-95d5aa-1536046640642)]
[圖片上傳失敗...(image-7379f1-1536046640642)]
callback回調函數里有一個indexArr參數,它是一個數組和絕,記錄著當前選中的位置:
把這個數組轉化為字元串之後,閉陸可以用<input type="hidden" value="">隱藏域或者別的其他方式保存下來,傳給後台。
下次打開頁面時,
MobileSelect實例化的時候,讀取這個字元串,再轉成數組,傳給position,完成初始化定位即可。
『玖』 Jquery日期控制項 WdatePicker.js怎麼用
用 onfocus=」WdatePicker()「 試試 把你的完整的引用代碼放出來看看唄。
『拾』 遇到多選擇項的時候,Taro-Picker組件如何使用
用框架做項目可以事半功倍,它封裝好的各種功能免去你很大部分的工作。taro+taroui可以很好的實現開發一次,多端運行為目的的小程序。
Taro UI - Picker 選擇器是從底部彈旅世殲起的滾動選擇器,從官網給出返首的示例拆沖來看,通過onChange可以改變值,state的數據儲存也是很簡單的
state={selector:['美國','中國','巴西','日本']}
但是做項目的時候,數據的結構不可能那麼簡單,有時候是多層嵌套+多個條件選擇,比如:
options數組里有3個對象,即要渲染出3個Picker選擇器。
在當前js中,是無法在循環條件下渲染出來選擇器的,就onChange觸發的函數來說,就沒法監聽是由哪個對象改變的。
其實解決辦法很簡單,將選擇器抽取出來為組件,父頁面循環數組給子組件傳遞單個對象,這樣渲染出來的每個選擇器都是相互獨立的,內調的onChange方法在子組件內部監聽,也不會影響其他選項。