详细问题描述
[内容]
dtpicker组件,使用var iTems =dtpicker.getSelectedItems()获取选中的对象时,
控制台报错:Uncaught TypeError: dtpicker.getSelectedItems is not a function,
重现步骤
[步骤]
[结果]
[期望]
运行环境
[系统版本] win7
[浏览器版本]chrome 版本 57.0.2987.98 (64-bit)
[IDE版本] HBuilder 8.0.2.201703061842
[mui版本]Mui v3.6.0
附件
[代码片段]
<body>
<script type="text/javascript">
mui.init()
</script>
<div class="mui-content">
<button type="button" class="mui-btn mui-btn-blue mui-btn-block" id="btn">按钮</button>
</div>
<script>
var dtpicker=new mui.DtPicker({
"type": "datetime",
"customData":{
"y":[
{ value: "y1", text: "鼠年" },
{ value: "y2", text: "龙年" },
{ value: "y3", text: "马年" },
{ value: "y4", text: "猪年" },
{ value: "y5", text: "猴年" }
],
"m":[
{ value: "m1", text: "January " },
{ value: "m2", text: "February" },
{ value: "m3", text: "March" },
{ value: "m4", text: "April" },
{ value: "m5", text: "May" }
],
'd':[
{ value: "d1", text: "今天" },
{ value: "d2", text: "明天" },
{ value: "d3", text: "后天" },
{ value: "d4", text: "大后天" },
{ value: "d5", text: "昨天" }
],
"h":[
{ value: "h1", text: "1小时" },
{ value: "h2", text: "2小时" },
{ value: "h3", text: "3小时" },
{ value: "h4", text: "4小时" },
{ value: "h5", text: "5小时" }
],
'i':[
{ value: "i1", text: "1分钟" },
{ value: "i2", text: "2分钟" },
{ value: "i3", text: "3分钟" },
{ value: "i4", text: "4分钟" },
{ value: "i5", text: "5分钟" }
]
},
beginDate: new Date(2015, 04, 25),
endDate: new Date(2016, 04, 25),
"labels":["猴子", "熊猫", "豹子","熊猫",'野猪']
}
);
mui('.mui-content').on('tap','#btn',function(){
dtpicker.show();
});
var iTems =dtpicker.getSelectedItems();
</script>
</body>
[安装包]
联系方式
[QQ]
[电话]
4***@qq.com
对头,var iTems = dtPicker.getSelectedItems() 换成 var iTems = dtpicker.getSelected()
2018-07-25 10:15