changelog.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <style>
  2. .page-changelog {
  3. padding-bottom: 100px;
  4. .fr {
  5. float: right;
  6. padding: 0;
  7. a {
  8. display: block;
  9. padding: 10px 15px;
  10. color: #475669;
  11. }
  12. &:hover a {
  13. color: #20a0ff;
  14. }
  15. }
  16. h2 {
  17. margin-bottom: 40px;
  18. }
  19. .timeline {
  20. margin: 0 0 0 105px;
  21. padding-left: 25px;
  22. position: relative;
  23. color: #5e6d82;
  24. &:before {
  25. content: '';
  26. width: 1px;
  27. height: 100%;
  28. position: absolute;
  29. left: 0;
  30. top: 10px;
  31. background-color: #eaeefa;
  32. }
  33. > li {
  34. list-style: none;
  35. position: relative;
  36. &:not(:last-child) {
  37. margin-bottom: 50px;
  38. }
  39. &:first-child {
  40. margin-top: -10px;
  41. h3:before {
  42. left: -33px;
  43. top: 5px;
  44. width: 16px;
  45. height: @width;
  46. background-color: #81c8fa;
  47. border: 0;
  48. }
  49. }
  50. }
  51. ul {
  52. padding-left: 0;
  53. }
  54. li li {
  55. font-size: 14px;
  56. list-style: none;
  57. padding-left: 0;
  58. &:before {
  59. content: '';
  60. circle: 4px #5e6d82;
  61. margin-right: 5px;
  62. display: inline-block;
  63. vertical-align: middle;
  64. }
  65. }
  66. h3 {
  67. margin: 0 0 10px;
  68. &:before {
  69. content: '';
  70. display: block;
  71. position: absolute;
  72. left: -31px;
  73. top: 7px;
  74. circle: 13px transparent;
  75. border: 2px solid #2ca2fc;
  76. box-sizing: border-box;
  77. background-color: #fff;
  78. }
  79. }
  80. h4 {
  81. margin: 50px 0 10px;
  82. }
  83. p {
  84. margin: 0;
  85. }
  86. em {
  87. position: absolute;
  88. left: -127px;
  89. font-style: normal;
  90. top: 4px;
  91. font-size: 14px;
  92. color: #99a9bf;
  93. }
  94. }
  95. }
  96. </style>
  97. <template>
  98. <div class="page-container page-changelog">
  99. <h2>
  100. <el-button class="fr">
  101. <a href="https://github.com/ElemeFE/element/releases" target="_blank">Github Releases</a>
  102. </el-button>
  103. 更新日志
  104. </h2>
  105. <ul class="timeline" ref="timeline">
  106. </ul>
  107. <change-log ref="changeLog"></change-log>
  108. </div>
  109. </template>
  110. <script>
  111. import ChangeLog from '../../CHANGELOG.md';
  112. export default {
  113. components: {
  114. ChangeLog
  115. },
  116. data() {
  117. return {
  118. count: 3
  119. };
  120. },
  121. mounted() {
  122. var changeLog = this.$refs.changeLog;
  123. var changeLogNodes = changeLog.$el.children;
  124. var fragments = '<li>' + changeLogNodes[1].outerHTML;
  125. for (let len = changeLogNodes.length, i = 2; i < len; i++) {
  126. let node = changeLogNodes[i];
  127. fragments += node.tagName !== 'H3'
  128. ? changeLogNodes[i].outerHTML
  129. : `</li><li>${changeLogNodes[i].outerHTML}`;
  130. }
  131. this.$refs.timeline.innerHTML = `${fragments}</li>`;
  132. changeLog.$el.remove();
  133. }
  134. };
  135. </script>