input_sz.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="index_sz">
  3. <view class="input_list" v-if="reserve">
  4. <view class="">
  5. {{label}}
  6. </view>
  7. <view class="">
  8. <input :type="type" name="" @input="onInput" :placeholder="ph">
  9. </view>
  10. </view>
  11. <view class="input_list_reserve" v-else>
  12. <view class="">
  13. <input :type="type" name="" @input="onInput" :placeholder="ph">
  14. </view>
  15. <view class="">
  16. {{label}}
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default{
  23. props:{
  24. type:{
  25. type:String,
  26. default:"text"
  27. },
  28. ph:{
  29. type:String,
  30. default:"ph"
  31. },
  32. label:{
  33. type:String,
  34. default:"labe"
  35. },
  36. reserve:{
  37. typeof:Boolean,
  38. default:true
  39. }
  40. },
  41. data(){
  42. return{
  43. }
  44. },
  45. methods:{
  46. onInput(e){
  47. this.val=e.target.value
  48. // console.log(this.val)
  49. this.$emit("input_content",this.val)
  50. }
  51. }
  52. }
  53. </script>
  54. <style scoped>
  55. .input_list input{
  56. width: 300rpx;
  57. height: 100rpx;
  58. /* background: #000; */
  59. width: 500rpx;
  60. height: 80rpx;
  61. text-align: right;
  62. font-size: 28rpx !important;
  63. }
  64. .input_list{
  65. width: 710rpx;
  66. height: 120rpx;
  67. background: #fff;
  68. margin: 0 auto;
  69. border-radius: 12rpx;
  70. display: flex;
  71. box-sizing: border-box;
  72. padding: 0 20rpx;
  73. }
  74. .input_list>view:first-child{
  75. width: 300rpx;
  76. font-size: 28rpx;
  77. font-weight: 500;
  78. color: 3d4440;
  79. }
  80. .input_list>view{
  81. align-self: center;
  82. }
  83. .input_list_reserve{
  84. width: 90%;
  85. height: 120rpx;
  86. background: #fff;
  87. margin: 0 auto;
  88. border-radius: 12rpx;
  89. display: flex;
  90. justify-content: space-between;
  91. box-sizing: border-box;
  92. padding: 0 20rpx;
  93. }
  94. .input_list_reserve>view:last-child{
  95. width: 100rpx;
  96. font-size: 30rpx;
  97. font-weight: 500;
  98. color: 3d4440;
  99. align-items: flex-end;
  100. }
  101. .input_list_reserve>view{
  102. align-self: center;
  103. }
  104. .input_list_reserve input{
  105. width: 300rpx;
  106. height: 100rpx;
  107. /* background: #000; */
  108. width: 500rpx;
  109. height: 80rpx;
  110. text-align: left;
  111. text-indent: 50rpx;
  112. font-size: 30rpx;
  113. }
  114. ::placeholder{
  115. color: #999;
  116. font-size: 28rpx;
  117. font-weight: 400;
  118. }
  119. </style>