keyboard.js 712 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Component({
  2. properties: {
  3. //是否需要mask
  4. mask: {
  5. type: Boolean,
  6. value: true
  7. },
  8. //控制键盘显示
  9. show: {
  10. type: Boolean,
  11. value: false
  12. },
  13. //是否直接显示,不需要动画,一般使用在锁屏密码
  14. action: {
  15. type: Boolean,
  16. value: true
  17. }
  18. },
  19. data: {
  20. itemList: 12
  21. },
  22. methods: {
  23. //关闭
  24. handleClose() {
  25. if (!this.data.show) {
  26. return;
  27. }
  28. this.triggerEvent('close', {});
  29. },
  30. handleClick(e) {
  31. if (!this.data.show) {
  32. return;
  33. }
  34. const dataset = e.currentTarget.dataset;
  35. this.triggerEvent('click', {
  36. index: dataset.index
  37. })
  38. }
  39. }
  40. })