ie-form-picker.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="flex-1 fx-row fx-bet-cen mx-border-b p-10 gap-10" @click="$emit('click')">
  3. <text class="flex-1 text-sm text-main keep-all">{{ label }}</text>
  4. <view class="fx-row items-center gap-10 text-lg">
  5. <slot>
  6. <view v-if="modelValue||desc" class="fx-col items-end">
  7. <text class="text-main break-all">{{ modelValue }}</text>
  8. <text class="text-primary-light break-all text-4xs">{{ desc }}</text>
  9. </view>
  10. <text v-else class="text-light">{{ placeholder }}</text>
  11. <uv-icon v-if="!remark&&!disableArrow" color="var(--light-color)" name="arrow-right"/>
  12. </slot>
  13. </view>
  14. <slot name="suffix">
  15. <text v-if="remark" class="text-sm text-main keep-all">{{ remark }}</text>
  16. </slot>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. name: "ie-form-picker",
  22. emits: ['click'], // 必须申明emits,否则在vue3里会响应2次click.
  23. props: {
  24. label: {
  25. type: String,
  26. default: ""
  27. },
  28. desc: {
  29. type: String,
  30. default: ''
  31. },
  32. placeholder: {
  33. type: String,
  34. default: "请选择"
  35. },
  36. modelValue: {
  37. type: [String, Number],
  38. default: ""
  39. },
  40. remark: {
  41. type: String,
  42. default: ''
  43. },
  44. disableArrow: {
  45. type: Boolean,
  46. default: false
  47. }
  48. }
  49. }
  50. </script>
  51. <style scoped>
  52. </style>