inputRow.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <script >
  2. export default {
  3. name: 'inputRow',
  4. props: {
  5. label: {
  6. type: String,
  7. default: ''
  8. },
  9. form: {
  10. type: Object,
  11. default: () => {}
  12. },
  13. checkFormItem: {
  14. type: Function,
  15. default: () => {}
  16. },
  17. state: {
  18. type: Number,
  19. default: 0
  20. },
  21. msg: {
  22. type: String,
  23. default: ''
  24. },
  25. remark: {
  26. type: String,
  27. default: ''
  28. }
  29. },
  30. data(){
  31. return {
  32. }
  33. },
  34. methods: {
  35. }
  36. }
  37. </script>
  38. <template>
  39. <div class="w-full px-1.5 flex">
  40. <div class="w-4/12 flex items-center u px-1">
  41. <p class="w-full text-justify">
  42. {{ label }}
  43. <!-- 显示一个问号,悬浮时显示remark, 不使用 a toolTip -->
  44. <a-tooltip v-if="remark" placement="topLeft">
  45. <template slot="title">
  46. {{remark}}
  47. </template>
  48. <a-icon type="question-circle" />
  49. </a-tooltip>
  50. </p>
  51. </div>
  52. <div class="w-8/12">
  53. <slot></slot>
  54. <div :class="`w-full ${state===0?'text-red-600':'text-green-300'}`" v-show="msg" >
  55. {{msg}}
  56. </div>
  57. <slot name="extra"></slot>
  58. </div>
  59. </div>
  60. </template>
  61. <style scoped>
  62. </style>