select.scss 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. @import '../common/base.scss';
  2. .m-select{
  3. width: 250px;
  4. height: 37px;
  5. position: relative;
  6. .m-select-input{
  7. width: 100%;
  8. height: 100%;
  9. padding: 0 5px;
  10. .m-select-input__inner{
  11. width: 100%;
  12. height: 100%;
  13. outline: none;
  14. border: 0;
  15. border-radius: 4px;
  16. padding: 10px 30px 10px 10px;
  17. margin: 0;
  18. box-sizing: border-box;
  19. color: #606266;
  20. background-color: transparent;
  21. cursor: pointer;
  22. border: 1px solid #dcdfe6;
  23. transition: all .2s ease;
  24. &:focus {
  25. border-color: #0e80eb;
  26. }
  27. }
  28. .select-icon{
  29. position: absolute;
  30. right: 10px;
  31. top: 11px;
  32. color: #94969b;
  33. transition: all .2s ease;
  34. cursor: pointer;
  35. transform-origin: 50% 50%;
  36. }
  37. }
  38. &.m-pagination-select{
  39. .select-icon{
  40. position: absolute;
  41. right: 10px;
  42. top: 8px;
  43. }
  44. }
  45. .m-select-option{
  46. min-width: 100%;
  47. height: auto;
  48. position: absolute;
  49. bottom: 0;
  50. border-radius: 4px;
  51. box-sizing: border-box;
  52. background-color: #fff;
  53. top: 100%;
  54. z-index: 99;
  55. .m-select-option-find{
  56. width: 100%;
  57. max-height: 215px;
  58. height: auto;
  59. position: relative;
  60. margin-top: 13px;
  61. padding: 4px 0px;
  62. box-sizing: border-box;
  63. background-color: #ffffff;
  64. border: 1px solid #dcdfe6f6;
  65. border-radius: 3px;
  66. transition: all 0.1s ease;
  67. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  68. &::before{
  69. content: '';
  70. display: block;
  71. width: 0;
  72. height: 0;
  73. position: absolute;
  74. top: -15.7px;
  75. right: 50.27%;
  76. padding: 0;
  77. border-bottom: 8px solid #ffffff;
  78. border-top: 8px solid transparent;
  79. border-left: 8px solid transparent;
  80. border-right: 8px solid transparent;
  81. z-index: 12;
  82. }
  83. &:after {
  84. content: "";
  85. display: block;
  86. box-sizing: content-box;
  87. width: 0px;
  88. height: 0px;
  89. position: absolute;
  90. top: -18px;
  91. right: 50%;
  92. padding: 0;
  93. border-bottom: 9px solid #dcdfe6f6;
  94. border-top: 9px solid transparent;
  95. border-left: 9px solid transparent;
  96. border-right: 9px solid transparent;
  97. z-index: 10;
  98. }
  99. ul{
  100. width: 100%;
  101. max-height: 205px;
  102. overflow-y: scroll;
  103. overflow-x: hidden;
  104. li{
  105. height: 34px;
  106. line-height: 34px;
  107. box-sizing: border-box;
  108. padding: 0 32px 0 20px;
  109. color: #606266;
  110. user-select: none;
  111. white-space: nowrap;
  112. cursor: pointer;
  113. &:hover {
  114. background: #f5f7fa;
  115. }
  116. .icon-select-bold{
  117. position: absolute;
  118. right: 20px;
  119. }
  120. }
  121. li.m-option-disabled{
  122. cursor: no-drop;
  123. color: #c0c4cc;
  124. &:hover {
  125. background-color: #fff;
  126. }
  127. }
  128. li.m-option-active{
  129. color: $primary;
  130. }
  131. .no-data{
  132. text-align: center;
  133. color: #999;
  134. }
  135. }
  136. ul::-webkit-scrollbar {
  137. display: block;
  138. width: 5px;
  139. height: 1px;
  140. }
  141. ul::-webkit-scrollbar-thumb {
  142. border-radius: 8px;
  143. background: #ccc;
  144. }
  145. ul::-webkit-scrollbar-track {
  146. border-radius: 8px;
  147. background: #fff;
  148. }
  149. }
  150. }
  151. .m-select-input-disabled{
  152. .m-select-input__inner{
  153. cursor: not-allowed;
  154. background-color: #f5f7fa;
  155. border-color: #e4e7ed;
  156. color: #c0c4cc;
  157. }
  158. }
  159. }
  160. // 动画
  161. .slide-fade-enter-active {
  162. transition: all 0.2s ease-out;
  163. }
  164. .slide-fade-leave-active {
  165. transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
  166. }
  167. .slide-fade-enter-from,
  168. .slide-fade-leave-to {
  169. transform: translateY(-20px);
  170. opacity: 0;
  171. }
  172. // .slide-fade-enter-active,
  173. // .slide-fade-leave-active {
  174. // opacity: 1;
  175. // transform: scaleY(1);
  176. // transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
  177. // transform-origin: center top;
  178. // }
  179. // .slide-fade-enter,
  180. // .slide-fade-leave-active {
  181. // opacity: 0;
  182. // transform: scaleY(0);
  183. // }
  184. .is-small {
  185. .m-pagination-select {
  186. .select-icon{
  187. position: absolute;
  188. top: 1px;
  189. }
  190. }
  191. }