index.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. icon: String,
  9. title: String,
  10. label: String,
  11. border: Boolean,
  12. checked: Boolean,
  13. loading: Boolean,
  14. disabled: Boolean,
  15. activeColor: String,
  16. inactiveColor: String,
  17. useLabelSlot: Boolean,
  18. size: {
  19. type: String,
  20. value: '24px'
  21. },
  22. activeValue: {
  23. type: null,
  24. value: true
  25. },
  26. inactiveValue: {
  27. type: null,
  28. value: false
  29. }
  30. },
  31. watch: {
  32. checked: function (value) {
  33. this.set({ value: value });
  34. }
  35. },
  36. created: function () {
  37. this.set({ value: this.data.checked });
  38. },
  39. methods: {
  40. onChange: function (event) {
  41. this.$emit('change', event.detail);
  42. }
  43. }
  44. });