14afb66dc51814c4531046a1a09c45f955780d090f8e282f1ca19f64b7288b9720864cf672d278eaf53c700c120c80d1bf72d6980f85f8a28dad2ed143ad3b 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @import "common/transition";
  4. @import "checkbox";
  5. @include b(tree) {
  6. position: relative;
  7. cursor: default;
  8. background: $--color-white;
  9. color: $--tree-font-color;
  10. @include e(empty-block) {
  11. position: relative;
  12. min-height: 60px;
  13. text-align: center;
  14. width: 100%;
  15. height: 100%;
  16. }
  17. @include e(empty-text) {
  18. position: absolute;
  19. left: 50%;
  20. top: 50%;
  21. transform: translate(-50%, -50%);
  22. color: $--color-text-secondary;
  23. font-size: $--font-size-base;
  24. }
  25. @include e(drop-indicator) {
  26. position: absolute;
  27. left: 0;
  28. right: 0;
  29. height: 1px;
  30. background-color: $--color-primary;
  31. }
  32. }
  33. @include b(tree-node) {
  34. white-space: nowrap;
  35. outline: none;
  36. &:focus { /* focus */
  37. > .el-tree-node__content {
  38. background-color: $--tree-node-hover-background-color;
  39. }
  40. }
  41. @include when(drop-inner) {
  42. > .el-tree-node__content .el-tree-node__label {
  43. background-color: $--color-primary;
  44. color: #fff;
  45. }
  46. }
  47. @include e(content) {
  48. display: flex;
  49. align-items: center;
  50. height: 26px;
  51. cursor: pointer;
  52. & > .el-tree-node__expand-icon {
  53. padding: 6px;
  54. }
  55. & > label.el-checkbox {
  56. margin-right: 8px;
  57. }
  58. &:hover {
  59. background-color: $--tree-node-hover-background-color;
  60. }
  61. .el-tree.is-dragging & {
  62. cursor: move;
  63. & * {
  64. pointer-events: none;
  65. }
  66. }
  67. .el-tree.is-dragging.is-drop-not-allow & {
  68. cursor: not-allowed;
  69. }
  70. }
  71. @include e(expand-icon) {
  72. cursor: pointer;
  73. color: $--tree-expand-icon-color;
  74. font-size: 12px;
  75. transform: rotate(0deg);
  76. transition: transform 0.3s ease-in-out;
  77. &.expanded {
  78. transform: rotate(90deg);
  79. }
  80. &.is-leaf {
  81. color: transparent;
  82. cursor: default;
  83. }
  84. }
  85. @include e(label) {
  86. font-size: $--font-size-base;
  87. }
  88. @include e(loading-icon) {
  89. margin-right: 8px;
  90. font-size: $--font-size-base;
  91. color: $--tree-expand-icon-color;
  92. }
  93. & > .el-tree-node__children {
  94. overflow: hidden;
  95. background-color: transparent;
  96. }
  97. &.is-expanded > .el-tree-node__children {
  98. display: block;
  99. }
  100. }
  101. .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
  102. background-color: mix($--color-white, $--color-primary, 92%);
  103. }