UNPKG

generator-minxing

Version:
198 lines (195 loc) 5.94 kB
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"> <title>MxUI</title> <link rel="stylesheet" href="../../styles/mx.css"/> <link rel="stylesheet" href="../../styles/example.css"/> <style> .page{ opacity: 1; } .page.home .font{ font-size: 27px; } .reset{ width: 100%; text-align: left; resize: none; margin-top: 8px; background: #fff; outline: none; font-size: 14px; padding: 12px 0 0; font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace; } pre{ padding: 10px 20px; background: #fff; border-radius: 4px; border:1px solid #eee; margin:10px 0; font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace; white-space: pre-wrap; max-width: 100%; word-wrap : break-word; } code{ font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace; } /* .pre{ overflow-y: scroll; max-height: 10rem; }*/ .mx-parent{ position: relative; display: block; } .mx-copy{ position: absolute; right: 0; display: block; font-size: 12px; text-align: right; padding: 5px 8px; background-color: #fff; color: #767676; border-radius: 4px; border: 1px solid #elele8; top: 11px; left: 0px; } .mx-copy-t{ top: 0; } .mx-copy-t6{ top: 6px; } .mx-copy:hover{ background-color: #563d7c; } </style> </head> <body> <div class="page"> <div class="page__hd"> <h1 class="page__title">Picker</h1> <p class="page__desc">多列选择器,需要配合js实现</p> </div> <div class="page__bd page__bd_spacing"> <a href="javascript:;" class="mx-btn mx-btn_default" id="showPicker">单列选择器</a> <div class="mx-parent"> <button class="mx-copy">copy</button> </div> <pre> &lt;a href="javascript:;" class="weui-btn weui-btn_default" id="showPicker"&gt;单列选择器&lt;/a&gt; &lt;script&gt; $('#showPicker').on('click', function () { weui.picker([{ label: '飞机票', value: 0 }, { label: '火车票', value: 1 }, { label: '的士票', value: 2 },{ label: '公交票 (disabled)', disabled: true, value: 3 }, { label: '其他', value: 4 }], { onChange: function (result) { console.log(result); }, onConfirm: function (result) { console.log(result); } }); }); &lt;/script&gt; </pre> <a href="javascript:;" class="mx-btn mx-btn_default" id="showDatePicker">日期选择器</a> <div class="mx-parent"> <button class="mx-copy">copy</button> </div> <pre> &lt;a href="javascript:;" class="weui-btn weui-btn_default" id="showDatePicker"&gt;日期选择器&lt;/a&gt; &lt;script&gt; $('#showDatePicker').on('click', function () { weui.datePicker({ start: 1990, end: new Date().getFullYear(), onChange: function (result) { console.log(result); }, onConfirm: function (result) { console.log(result); } }); }); &lt;/script&gt; </pre> </div> </div> <script src="../../scripts/zepto.min.js"></script> <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> <script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script> <script src="../../scripts/clipboard.min.js"></script> <script> var clipboard = new Clipboard('.mx-parent',{ target: function(trigger) { return trigger.nextElementSibling; } }); clipboard.on('success', function(e) { console.log(e); }); clipboard.on('error', function(e) { console.log(e); }); </script> <script type="text/javascript"> $('#showPicker').on('click', function () { weui.picker([{ label: '飞机票', value: 0 }, { label: '火车票', value: 1 }, { label: '的士票', value: 2 },{ label: '公交票 (disabled)', disabled: true, value: 3 }, { label: '其他', value: 4 }], { onChange: function (result) { console.log(result); }, onConfirm: function (result) { console.log(result); } }); }); $('#showDatePicker').on('click', function () { weui.datePicker({ start: 1990, end: new Date().getFullYear(), onChange: function (result) { console.log(result); }, onConfirm: function (result) { console.log(result); } }); }); </script> </body> </html>