u--input.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <uvInput
  3. :value="value"
  4. :type="type"
  5. :fixed="fixed"
  6. :disabled="disabled"
  7. :disabledColor="disabledColor"
  8. :clearable="clearable"
  9. :password="password"
  10. :maxlength="maxlength"
  11. :placeholder="placeholder"
  12. :placeholderClass="placeholderClass"
  13. :placeholderStyle="placeholderStyle"
  14. :showWordLimit="showWordLimit"
  15. :confirmType="confirmType"
  16. :confirmHold="confirmHold"
  17. :holdKeyboard="holdKeyboard"
  18. :focus="focus"
  19. :autoBlur="autoBlur"
  20. :disableDefaultPadding="disableDefaultPadding"
  21. :cursor="cursor"
  22. :cursorSpacing="cursorSpacing"
  23. :selectionStart="selectionStart"
  24. :selectionEnd="selectionEnd"
  25. :adjustPosition="adjustPosition"
  26. :inputAlign="inputAlign"
  27. :fontSize="fontSize"
  28. :color="color"
  29. :prefixIcon="prefixIcon"
  30. :suffixIcon="suffixIcon"
  31. :suffixIconStyle="suffixIconStyle"
  32. :prefixIconStyle="prefixIconStyle"
  33. :border="border"
  34. :readonly="readonly"
  35. :shape="shape"
  36. :customStyle="customStyle"
  37. :formatter="formatter"
  38. @focus="$emit('focus')"
  39. @blur="e => $emit('blur', e)"
  40. @keyboardheightchange="$emit('keyboardheightchange')"
  41. @change="e => $emit('change', e)"
  42. @input="e => $emit('input', e)"
  43. @confirm="e => $emit('confirm', e)"
  44. @clear="$emit('clear')"
  45. @click="$emit('click')"
  46. >
  47. <!-- #ifdef MP -->
  48. <slot name="prefix"></slot>
  49. <slot name="suffix"></slot>
  50. <!-- #endif -->
  51. <!-- #ifndef MP -->
  52. <slot name="prefix" slot="prefix"></slot>
  53. <slot name="suffix" slot="suffix"></slot>
  54. <!-- #endif -->
  55. </uvInput>
  56. </template>
  57. <script>
  58. /**
  59. * 此组件存在的理由是,在nvue下,u-input被uni-app官方占用了,u-input在nvue中相当于input组件
  60. * 所以在nvue下,取名为u--input,内部其实还是u-input.vue,只不过做一层中转
  61. */
  62. import uvInput from '../u-input/u-input.vue';
  63. import props from '../u-input/props.js'
  64. export default {
  65. name: 'u--input',
  66. mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
  67. components: {
  68. uvInput
  69. },
  70. }
  71. </script>