changelog.vue 3.0 KB

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