2020-03-25

citypicker添加 操作按钮,以清除为例

通过toolbarTemplate 自定义工具栏操作按钮 $("#history1").cityPicker({ title: "地址选择", value: his1.join(" "), toolbarTemplate: '
' + '
' + '完成' + '

地址选择

' + '清除' + '
' + '
', onChange: function (e) { // history1 = e.displayValue.join("-"); } }); //清除输入框内容 $("body").on("click", ".clear-button1", function () { $("#history1").val(""); }); 自定义按钮css样式: .toolbar .toolbar-inner .clear-button { position: absolute; left: 0; box-sizing: border-box; height: 2.2rem; line-height: 2.2rem; color: #0093FD; z-index: 1; padding: 0 .5rem; }

效果如下:


calendar操作按钮自定义.png

你可能感兴趣的:(2020-03-25)