logo

pleroma-fe

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

number_setting.js (489B)


  1. import Setting from './setting.js'
  2. export default {
  3. ...Setting,
  4. props: {
  5. ...Setting.props,
  6. truncate: {
  7. type: Number,
  8. required: false,
  9. default: 1
  10. }
  11. },
  12. methods: {
  13. ...Setting.methods,
  14. getValue (e) {
  15. if (!this.truncate === 1) {
  16. return parseInt(e.target.value)
  17. } else if (this.truncate > 1) {
  18. return Math.trunc(e.target.value / this.truncate) * this.truncate
  19. }
  20. return parseFloat(e.target.value)
  21. }
  22. }
  23. }