changelog.tpl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <style>
  2. .page-changelog {
  3. padding-bottom: 100px;
  4. .fr {
  5. float: right;
  6. padding: 0;
  7. &.el-button {
  8. transform: translateY(-3px);
  9. }
  10. a {
  11. display: block;
  12. padding: 10px 15px;
  13. color: #333;
  14. }
  15. &:hover a {
  16. color: #20a0ff;
  17. }
  18. }
  19. .heading {
  20. font-size: 24px;
  21. margin-bottom: 60px;
  22. color: #333;
  23. }
  24. .timeline {
  25. padding: 0;
  26. padding-bottom: 10px;
  27. position: relative;
  28. color: #5e6d82;
  29. > li {
  30. position: relative;
  31. padding-bottom: 15px;
  32. list-style: none;
  33. line-height: 1.8;
  34. border: 1px solid #ddd;
  35. border-radius: 4px;
  36. &:not(:last-child) {
  37. margin-bottom: 50px;
  38. }
  39. }
  40. ul {
  41. padding: 30px 30px 15px;
  42. ul {
  43. padding: 0;
  44. padding-top: 5px;
  45. padding-left: 27px;
  46. li {
  47. padding-left: 0;
  48. color: #555;
  49. }
  50. li::before {
  51. content: '';
  52. circle: 4px #fff;
  53. border: solid 1px #333;
  54. margin-right: -12px;
  55. display: inline-block;
  56. vertical-align: middle;
  57. }
  58. }
  59. }
  60. li li {
  61. font-size: 16px;
  62. list-style: none;
  63. padding-left: 20px;
  64. padding-bottom: 5px;
  65. color: #333;
  66. word-break: break-all;
  67. &:before {
  68. content: '';
  69. circle: 6px #333;
  70. transform: translateX(-20px);
  71. display: inline-block;
  72. vertical-align: middle;
  73. }
  74. }
  75. h3 {
  76. margin:0;
  77. padding: 15px 30px;
  78. border-bottom: 1px solid #ddd;
  79. font-size: 20px;
  80. color: #333;
  81. font-weight: bold;
  82. a {
  83. opacity: 1;
  84. font-size: 20px;
  85. float: none;
  86. margin-left: 0;
  87. color: #333;
  88. }
  89. }
  90. h4 {
  91. margin: 0;
  92. margin-bottom: -10px;
  93. font-size: 18px;
  94. padding-left: 54px;
  95. padding-top: 30px;
  96. font-weight: bold;
  97. }
  98. p {
  99. margin: 0;
  100. }
  101. em {
  102. position: absolute;
  103. right: 30px;
  104. font-style: normal;
  105. top: 23px;
  106. font-size: 16px;
  107. color: #666;
  108. }
  109. }
  110. }
  111. </style>
  112. <template>
  113. <div class="page-changelog">
  114. <div class="heading">
  115. <el-button class="fr">
  116. <a href="https://github.com/ElemeFE/element/releases" target="_blank">Github Releases</a>
  117. </el-button>
  118. <%= 1 >
  119. </div>
  120. <ul class="timeline" ref="timeline">
  121. </ul>
  122. <change-log ref="changeLog"></change-log>
  123. </div>
  124. </template>
  125. <script>
  126. import ChangeLog from '../../../CHANGELOG.<%= 2 >.md';
  127. export default {
  128. components: {
  129. ChangeLog
  130. },
  131. data() {
  132. return {
  133. count: 3
  134. };
  135. },
  136. mounted() {
  137. const changeLog = this.$refs.changeLog;
  138. const changeLogNodes = changeLog.$el.children;
  139. let a = changeLogNodes[1].querySelector('a');
  140. a && a.remove();
  141. let release = changeLogNodes[1].textContent.trim();
  142. let fragments = `<li><h3><a href="https://github.com/ElemeFE/element/releases/tag/v${release}" target="_blank">${release}</a></h3>`;
  143. for (let len = changeLogNodes.length, i = 2; i < len; i++) {
  144. let node = changeLogNodes[i];
  145. a = changeLogNodes[i].querySelector('a');
  146. a && a.getAttribute('class') === 'header-anchor' && a.remove();
  147. if (node.tagName !== 'H3') {
  148. fragments += changeLogNodes[i].outerHTML;
  149. } else {
  150. release = changeLogNodes[i].textContent.trim();
  151. fragments += `</li><li><h3><a href="https://github.com/ElemeFE/element/releases/tag/v${release}" target="_blank">${release}</a></h3>`;
  152. }
  153. }
  154. fragments = fragments.replace(/#(\d+)/g, '<a href="https://github.com/ElemeFE/element/issues/$1" target="_blank">#$1</a>');
  155. fragments = fragments.replace(/@(\w+)/g, '<a href="https://github.com/$1" target="_blank">@$1</a>');
  156. this.$refs.timeline.innerHTML = `${fragments}</li>`;
  157. changeLog.$el.remove();
  158. }
  159. };
  160. </script>