index.js 863 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { VantComponent } from '../common/component';
  2. import { BLUE } from '../common/color';
  3. import { addUnit } from '../common/utils';
  4. VantComponent({
  5. props: {
  6. inactive: Boolean,
  7. percentage: Number,
  8. pivotText: String,
  9. pivotColor: String,
  10. trackColor: String,
  11. showPivot: {
  12. type: Boolean,
  13. value: true
  14. },
  15. color: {
  16. type: String,
  17. value: BLUE
  18. },
  19. textColor: {
  20. type: String,
  21. value: '#fff'
  22. },
  23. strokeWidth: {
  24. type: null,
  25. observer: 'setStrokeWidthUnit'
  26. }
  27. },
  28. data: {
  29. strokeWidthUnit: '4px'
  30. },
  31. methods: {
  32. setStrokeWidthUnit(val) {
  33. this.setData({
  34. strokeWidthUnit: addUnit(val)
  35. });
  36. }
  37. }
  38. });