index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. classes: ['field-class', 'input-class', 'cancel-class'],
  7. props: {
  8. focus: Boolean,
  9. error: Boolean,
  10. disabled: Boolean,
  11. readonly: Boolean,
  12. inputAlign: String,
  13. showAction: Boolean,
  14. useActionSlot: Boolean,
  15. placeholder: String,
  16. placeholderStyle: String,
  17. background: {
  18. type: String,
  19. value: '#ffffff'
  20. },
  21. maxlength: {
  22. type: Number,
  23. value: -1
  24. },
  25. shape: {
  26. type: String,
  27. value: 'square'
  28. },
  29. label: String
  30. },
  31. methods: {
  32. onChange: function (event) {
  33. this.set({ value: event.detail });
  34. this.$emit('change', event.detail);
  35. },
  36. onCancel: function () {
  37. this.set({ value: '' });
  38. this.$emit('cancel');
  39. this.$emit('change', '');
  40. },
  41. onSearch: function () {
  42. this.$emit('search', this.data.value);
  43. },
  44. onFocus: function () {
  45. this.$emit('focus');
  46. },
  47. onBlur: function () {
  48. this.$emit('blur');
  49. },
  50. onClear: function () {
  51. this.$emit('clear');
  52. },
  53. }
  54. });