group.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="uni-wrap">
  3. <scroll-view class="scroll" scroll-y>
  4. <view class="example-info">
  5. <text class="example-info-text"> uni-group 组件主要用于表单分组 </text>
  6. </view>
  7. <uni-group title="group 1" margin-top="20">
  8. <uni-field v-model="name" label="姓名" placeholder="请填写姓名" :error-message="errorMessage"></uni-field>
  9. <uni-field v-model="mobile" label="手机号" label-position="left" placeholder="请填写手机号" :error-message="errorMessage" type="text" :clearable="true">
  10. <button v-if="true" type="primary" slot="right" size="mini">发送验证码</button>
  11. </uni-field>
  12. </uni-group>
  13. <uni-group title="group 2">
  14. <uni-field v-model="name" label="身高" placeholder="请填写身高" :error-message="errorMessage"></uni-field>
  15. <uni-field v-model="mobile" label="体重" label-position="left" placeholder="请填写体重" :error-message="errorMessage" type="text" :clearable="true">
  16. </uni-field>
  17. </uni-group>
  18. <uni-group title="group 3">
  19. <uni-field v-model="mobile" label="邮箱" label-position="left" placeholder="请填写邮箱" :error-message="errorMessage" type="text" :clearable="true">
  20. </uni-field>
  21. <uni-field v-model="weixin" label="微信号" label-position="left" placeholder="请填写微信号" :required="false" :focus="true" type="text" :clearable="true" :password="false" :disabled="false" confirmType="good" :error-message="errorMessage" />
  22. <uni-field v-model="message" type="textarea" label="家庭地址" placeholder="请填写详细住址" :error-message="errorMessage" />
  23. </uni-group>
  24. </scroll-view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. appear: false,
  33. name: '',
  34. mobile: '139 9999 9999',
  35. weixin: 'sskd',
  36. message: '',
  37. errorMessage: ''
  38. }
  39. },
  40. onReady() {
  41. },
  42. methods: {
  43. }
  44. }
  45. </script>
  46. <style>
  47. @charset "UTF-8";
  48. /* 头条小程序组件内不能引入字体 */
  49. /* #ifdef MP-TOUTIAO */
  50. @font-face {
  51. font-family: uniicons;
  52. font-weight: normal;
  53. font-style: normal;
  54. src: url("~@/static/uni.ttf") format("truetype");
  55. }
  56. /* #endif */
  57. /* #ifndef APP-NVUE */
  58. page {
  59. display: flex;
  60. flex-direction: column;
  61. box-sizing: border-box;
  62. background-color: #efeff4;
  63. min-height: 100%;
  64. height: auto;
  65. }
  66. view {
  67. font-size: 14px;
  68. line-height: inherit;
  69. }
  70. .example {
  71. padding: 0 15px 15px;
  72. }
  73. .example-info {
  74. padding: 15px;
  75. color: #3b4144;
  76. background: #ffffff;
  77. }
  78. .example-body {
  79. /* #ifndef APP-NVUE */
  80. display: flex;
  81. /* #endif */
  82. flex-direction: row;
  83. flex-wrap: wrap;
  84. justify-content: center;
  85. padding: 0;
  86. font-size: 14px;
  87. background-color: #ffffff;
  88. }
  89. /* #endif */
  90. .example {
  91. padding: 0 15px;
  92. }
  93. .example-info {
  94. /* #ifndef APP-NVUE */
  95. display: block;
  96. /* #endif */
  97. padding: 15px;
  98. color: #3b4144;
  99. background-color: #ffffff;
  100. font-size: 14px;
  101. line-height: 20px;
  102. }
  103. .example-info-text {
  104. font-size: 14px;
  105. line-height: 20px;
  106. color: #3b4144;
  107. }
  108. .example-body {
  109. flex-direction: column;
  110. padding: 15px;
  111. background-color: #ffffff;
  112. }
  113. .word-btn-white {
  114. font-size: 18px;
  115. color: #FFFFFF;
  116. }
  117. .word-btn {
  118. /* #ifndef APP-NVUE */
  119. display: flex;
  120. /* #endif */
  121. flex-direction: row;
  122. align-items: center;
  123. justify-content: center;
  124. border-radius: 6px;
  125. height: 48px;
  126. margin: 15px;
  127. background-color: #007AFF;
  128. }
  129. .word-btn--hover {
  130. background-color: #4ca2ff;
  131. }
  132. .uni-wrap {
  133. flex-direction: column;
  134. /* #ifdef H5 */
  135. height: calc(100vh - 44px);
  136. /* #endif */
  137. /* #ifndef H5 */
  138. height: 100vh;
  139. /* #endif */
  140. flex: 1;
  141. }
  142. .scroll {
  143. flex-direction: column;
  144. flex: 1;
  145. }
  146. .example-body {
  147. padding: 0;
  148. /* #ifndef APP-NVUE */
  149. display: block;
  150. /* #endif */
  151. }
  152. </style>