数字键盘 Keyboard & KeyboardPicker

基本用法

数字键盘 Keyboard - 图1

  1. <template lang="html">
  2. <div>
  3. <div class="demo-hidden">
  4. <za-panel>
  5. <za-panel-header title="类型"></za-panel-header>
  6. <za-panel-body>
  7. <za-cell title='数字' @click="showPicker('visible1')">
  8. {{v1}}
  9. </za-cell>
  10. <za-cell title='金额' @click="showPicker('visible2')">
  11. {{v2}}
  12. </za-cell>
  13. <za-cell title='证件' @click="showPicker('visible3')">
  14. {{v3}}
  15. </za-cell>
  16. </za-panel-body>
  17. </za-panel>
  18. <za-panel>
  19. <za-panel-header title="键盘"></za-panel-header>
  20. <za-panel-body>
  21. <za-keyboard type="number" ></za-panel-header>
  22. </za-panel-body>
  23. </za-panel>
  24. <za-keyboard-picker :visible.sync="visible1" type="number" @keyClick="handleChange1" ></za-keyboard-picker>
  25. <za-keyboard-picker :visible.sync="visible2" type="price" @keyClick="handleChange2" ></za-keyboard-picker>
  26. <za-keyboard-picker :visible.sync="visible3" type="idcard" @keyClick="handleChange3" ></za-keyboard-picker>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. v1:'',
  35. v2:'这是一个textarea',
  36. v3:'',
  37. v4:'',
  38. v5:'',
  39. v6:'',
  40. v7:'327198092039342',
  41. }
  42. },
  43. methods: {
  44. handleChange(v) {
  45. console.log(this.v1, v);
  46. },
  47. handleChange2(v) {
  48. console.log(this.v2, v);
  49. },
  50. handleChange3(v) {
  51. console.log(v);
  52. },
  53. focus() {
  54. this.$refs.inputFirst.focus()
  55. },
  56. },
  57. };
  58. </script>

API

keyboard Attributes

属性类型默认值可选值/参数说明
prefixClsstringza-keyboard类名前缀
typestring'number'键盘类型,可选number,price,idcard

keyboardPicker Attributes

属性类型默认值可选值/参数说明
visibleboolfalse是否显示, 支持.sync修饰符 (v2.3.0+)

keyboard & keyboardPicker Events

事件名称说明回调参数
keyClick当点击键盘时触发的事件最新点击的值