u--input.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. :ignoreCompositionEvent="ignoreCompositionEvent"
  39. @focus="$emit('focus')"
  40. @blur="e => $emit('blur', e)"
  41. @keyboardheightchange="$emit('keyboardheightchange')"
  42. @change="e => $emit('change', e)"
  43. @input="e => $emit('input', e)"
  44. @confirm="e => $emit('confirm', e)"
  45. @clear="$emit('clear')"
  46. @click="$emit('click')"
  47. >
  48. <!-- #ifdef MP -->
  49. <slot name="prefix"></slot>
  50. <slot name="suffix"></slot>
  51. <!-- #endif -->
  52. <!-- #ifndef MP -->
  53. <slot name="prefix" slot="prefix"></slot>
  54. <slot name="suffix" slot="suffix"></slot>
  55. <!-- #endif -->
  56. </uvInput>
  57. </template>
  58. <script>
  59. /**
  60. * 此组件存在的理由是,在nvue下,u-input被uni-app官方占用了,u-input在nvue中相当于input组件
  61. * 所以在nvue下,取名为u--input,内部其实还是u-input.vue,只不过做一层中转
  62. */
  63. import uvInput from '../u-input/u-input.vue';
  64. import props from '../u-input/props.js'
  65. export default {
  66. name: 'u--input',
  67. mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
  68. components: {
  69. uvInput
  70. },
  71. }
  72. </script>