index.js 746 B

1234567891011121314151617181920212223242526272829303132
  1. import { VantComponent } from '../common/component';
  2. import { addUnit } from '../common/utils';
  3. VantComponent({
  4. props: {
  5. color: String,
  6. vertical: Boolean,
  7. type: {
  8. type: String,
  9. value: 'circular'
  10. },
  11. size: {
  12. type: String,
  13. observer: 'setSizeWithUnit'
  14. },
  15. textSize: {
  16. type: String,
  17. observer: 'setTextSizeWithUnit'
  18. }
  19. },
  20. methods: {
  21. setSizeWithUnit(size) {
  22. this.setData({
  23. sizeWithUnit: addUnit(size)
  24. });
  25. },
  26. setTextSizeWithUnit(size) {
  27. this.set({
  28. textSizeWithUnit: addUnit(size)
  29. });
  30. }
  31. }
  32. });