logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

number_setting.js (724B)


  1. import Setting from './setting.js'
  2. export default {
  3. ...Setting,
  4. props: {
  5. ...Setting.props,
  6. min: {
  7. type: Number,
  8. required: false,
  9. default: 1
  10. },
  11. max: {
  12. type: Number,
  13. required: false,
  14. default: 1
  15. },
  16. step: {
  17. type: Number,
  18. required: false,
  19. default: 1
  20. },
  21. truncate: {
  22. type: Number,
  23. required: false,
  24. default: 1
  25. }
  26. },
  27. methods: {
  28. ...Setting.methods,
  29. getValue (e) {
  30. if (!this.truncate === 1) {
  31. return parseInt(e.target.value)
  32. } else if (this.truncate > 1) {
  33. return Math.trunc(e.target.value / this.truncate) * this.truncate
  34. }
  35. return parseFloat(e.target.value)
  36. }
  37. }
  38. }