Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import baseComponent from '../helpers/baseComponent'
  2. baseComponent({
  3. externalClasses: ['wux-class'],
  4. properties: {
  5. type: {
  6. type: String,
  7. value: '',
  8. },
  9. size: {
  10. type: [String, Number],
  11. value: 32,
  12. observer: 'updated',
  13. },
  14. color: {
  15. type: String,
  16. value: '',
  17. },
  18. hidden: {
  19. type: Boolean,
  20. value: false,
  21. },
  22. },
  23. data: {
  24. fontSize: '',
  25. },
  26. methods: {
  27. updated(size = this.data.size) {
  28. let fontSize = size
  29. if (typeof size === 'number') {
  30. fontSize = `${size}px`
  31. } else if (typeof size === 'string') {
  32. if (!isNaN(Number(size))) {
  33. fontSize = `${size}px`
  34. }
  35. }
  36. if (this.data.fontSize !== fontSize) {
  37. this.setData({
  38. fontSize,
  39. })
  40. }
  41. },
  42. },
  43. attached() {
  44. this.updated()
  45. },
  46. })