index.js 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var component_1 = require("../common/component");
  4. component_1.VantComponent({
  5. field: true,
  6. props: {
  7. value: null,
  8. title: String,
  9. border: Boolean,
  10. checked: Boolean,
  11. loading: Boolean,
  12. disabled: Boolean,
  13. activeColor: String,
  14. inactiveColor: String,
  15. size: {
  16. type: String,
  17. value: '24px'
  18. },
  19. activeValue: {
  20. type: null,
  21. value: true
  22. },
  23. inactiveValue: {
  24. type: null,
  25. value: false
  26. }
  27. },
  28. watch: {
  29. checked: function (value) {
  30. this.set({ value: value });
  31. }
  32. },
  33. created: function () {
  34. this.set({ value: this.data.checked });
  35. },
  36. methods: {
  37. onChange: function (event) {
  38. this.$emit('change', event.detail);
  39. }
  40. }
  41. });