index.js 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Copyright (C) 2018-2019
  3. * All rights reserved, Designed By www.joolun.com
  4. * 注意:
  5. * 本软件为www.joolun.com开发研制,项目使用请保留此说明
  6. */
  7. Component({
  8. properties: {
  9. max: {
  10. type: Number,
  11. value: 0
  12. },
  13. min: {
  14. type: Number,
  15. value: 0
  16. },
  17. stNum: {
  18. type: Number,
  19. value: 0
  20. },
  21. customClass:{
  22. type: String,
  23. value: ''
  24. }
  25. },
  26. data: {
  27. },
  28. methods: {
  29. stNumMinus() {
  30. this.setData({
  31. stNum: this.data.stNum - 1
  32. })
  33. this.triggerEvent('numChange', this.data.stNum)
  34. },
  35. stNumAdd() {
  36. this.setData({
  37. stNum: this.data.stNum + 1
  38. })
  39. this.triggerEvent('numChange', this.data.stNum)
  40. },
  41. numChange(e){
  42. this.triggerEvent('numChange', val)
  43. }
  44. }
  45. })