cell.nvue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="cell-page">
  3. <view class="u-page__item">
  4. <text class="u-page__item__title">基础功能</text>
  5. <u-cell-group>
  6. <u-cell
  7. title="uView UI"
  8. value="内容"
  9. :isLink="true"
  10. ></u-cell>
  11. <u-cell
  12. title="利剑出鞘,一统江湖"
  13. value="内容"
  14. label="挣脱束缚,向往自由"
  15. ></u-cell>
  16. </u-cell-group>
  17. </view>
  18. <view class="u-page__item">
  19. <text class="u-page__item__title">自定义图标/图片</text>
  20. <u-cell-group>
  21. <u-cell
  22. title="单元格"
  23. icon="lock-fill"
  24. ></u-cell>
  25. <u-cell
  26. title="单元格"
  27. icon="https://cdn.uviewui.com/uview/example/tag.png"
  28. ></u-cell>
  29. </u-cell-group>
  30. </view>
  31. <view class="u-page__item">
  32. <text class="u-page__item__title">自定义大小</text>
  33. <u-cell-group>
  34. <u-cell
  35. size="large"
  36. title="单元格"
  37. value="内容"
  38. isLink
  39. ></u-cell>
  40. <u-cell
  41. size="large"
  42. title="单元格"
  43. value="内容"
  44. label="描述信息"
  45. ></u-cell>
  46. </u-cell-group>
  47. </view>
  48. <view class="u-page__item">
  49. <text class="u-page__item__title">显示右箭头</text>
  50. <u-cell-group>
  51. <u-cell
  52. title="单元格"
  53. value="组件"
  54. isLink
  55. ></u-cell>
  56. <u-cell
  57. title="单元格"
  58. value="工具"
  59. arrow-direction="up"
  60. isLink
  61. ></u-cell>
  62. <u-cell
  63. title="单元格"
  64. value="模板"
  65. arrow-direction="down"
  66. isLink
  67. ></u-cell>
  68. </u-cell-group>
  69. </view>
  70. <view class="u-page__item">
  71. <text class="u-page__item__title">跳转页面</text>
  72. <u-cell-group>
  73. <u-cell
  74. title="打开标签页"
  75. isLink
  76. url="/pages/componentsB/tag/tag"
  77. ></u-cell>
  78. <u-cell
  79. title="打开徽标页"
  80. isLink
  81. url="/pages/componentsB/badge/badge"
  82. ></u-cell>
  83. </u-cell-group>
  84. </view>
  85. <view class="u-page__item">
  86. <text class="u-page__item__title">右侧内容垂直居中</text>
  87. <u-cell-group>
  88. <u-cell
  89. title="单元格"
  90. value="内容"
  91. label="描述信息"
  92. center
  93. ></u-cell>
  94. </u-cell-group>
  95. </view>
  96. <view class="u-page__item">
  97. <text class="u-page__item__title">自定义插槽</text>
  98. <u-cell-group>
  99. <u-cell value="内容">
  100. <view
  101. slot="title"
  102. class="u-slot-title"
  103. >
  104. <text class="u-cell-text">单元格</text>
  105. <u-tag
  106. text="标签"
  107. plain
  108. size="mini"
  109. type="warning"
  110. >
  111. </u-tag>
  112. </view>
  113. </u-cell>
  114. <u-cell
  115. title="单元格"
  116. isLink
  117. >
  118. <text
  119. slot="value"
  120. class="u-slot-value"
  121. >99</text>
  122. </u-cell>
  123. </u-cell-group>
  124. </view>
  125. <u-gap height="30"></u-gap>
  126. </view>
  127. </template>
  128. <script>
  129. export default {
  130. data() {
  131. return {}
  132. },
  133. methods: {
  134. click() {
  135. console.log('Cell is clicked.');
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. .cell-page {
  142. padding-bottom: 20px;
  143. }
  144. .cell-box {
  145. &__title {
  146. font-size: 14px;
  147. color: rgb(143, 156, 162);
  148. margin: 20px 0px 0px 15px;
  149. }
  150. &__block {
  151. // background-color: #fff;
  152. margin-top: 20px;
  153. }
  154. }
  155. .u-page {
  156. padding: 0;
  157. &__item {
  158. &__title {
  159. color: $u-tips-color;
  160. background-color: $u-bg-color;
  161. padding: 15px;
  162. font-size: 15px;
  163. &__slot-title {
  164. color: $u-primary;
  165. font-size: 14px;
  166. }
  167. }
  168. }
  169. }
  170. .u-slot-title {
  171. @include flex;
  172. flex-direction: row;
  173. align-items: center;
  174. }
  175. .u-cell-text {
  176. font-size: 15px;
  177. line-height: 22px;
  178. color: #303133;
  179. margin-right: 5px;
  180. }
  181. .u-slot-value {
  182. line-height: 17px;
  183. text-align: center;
  184. font-size: 10px;
  185. padding: 0 5px;
  186. height: 17px;
  187. color: #FFFFFF;
  188. border-radius: 100px;
  189. background-color: #f56c6c;
  190. }
  191. </style>