u--input.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <uvInput
  3. <!-- #ifdef VUE2 -->
  4. :value="value"
  5. @input="e => $emit('input', e)"
  6. <!-- #endif -->
  7. <!-- #ifdef VUE3 -->
  8. :modelValue="modelValue"
  9. @update:modelValue="e => $emit('update:modelValue', e)"
  10. <!-- #endif -->
  11. :type="type"
  12. :fixed="fixed"
  13. :disabled="disabled"
  14. :disabledColor="disabledColor"
  15. :clearable="clearable"
  16. :password="password"
  17. :maxlength="maxlength"
  18. :placeholder="placeholder"
  19. :placeholderClass="placeholderClass"
  20. :placeholderStyle="placeholderStyle"
  21. :showWordLimit="showWordLimit"
  22. :confirmType="confirmType"
  23. :confirmHold="confirmHold"
  24. :holdKeyboard="holdKeyboard"
  25. :focus="focus"
  26. :autoBlur="autoBlur"
  27. :disableDefaultPadding="disableDefaultPadding"
  28. :cursor="cursor"
  29. :cursorSpacing="cursorSpacing"
  30. :selectionStart="selectionStart"
  31. :selectionEnd="selectionEnd"
  32. :adjustPosition="adjustPosition"
  33. :inputAlign="inputAlign"
  34. :fontSize="fontSize"
  35. :color="color"
  36. :prefixIcon="prefixIcon"
  37. :suffixIcon="suffixIcon"
  38. :suffixIconStyle="suffixIconStyle"
  39. :prefixIconStyle="prefixIconStyle"
  40. :border="border"
  41. :readonly="readonly"
  42. :shape="shape"
  43. :customStyle="customStyle"
  44. :formatter="formatter"
  45. :ignoreCompositionEvent="ignoreCompositionEvent"
  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. import mpMixin from '../../libs/mixin/mpMixin.js';
  65. import mixin from '../../libs/mixin/mixin.js';
  66. export default {
  67. name: 'u--input',
  68. mixins: [mpMixin, props, mixin],
  69. components: {
  70. uvInput
  71. },
  72. }
  73. </script>