2020-08-13 15:18:26 +08:00
|
|
|
<template>
|
|
|
|
<div class="page-changelog">
|
|
|
|
<div class="heading">
|
|
|
|
<el-button class="fr">
|
2020-12-07 10:57:25 +08:00
|
|
|
<a href="https://github.com/element-plus/element-plus/releases" target="_blank">GitHub Releases</a>
|
2020-08-13 15:18:26 +08:00
|
|
|
</el-button>
|
|
|
|
{{ langConfig[1] }}
|
|
|
|
</div>
|
|
|
|
<ul ref="timeline" class="timeline">
|
|
|
|
</ul>
|
2021-08-03 20:53:44 +08:00
|
|
|
<!-- <change-log-cn v-if="lang === 'zh-CN'" ref="changeLog" /> -->
|
|
|
|
<!-- <change-log-es v-if="lang === 'es'" ref="changeLog" /> -->
|
|
|
|
<change-log-en ref="changeLog" />
|
|
|
|
<!-- <change-log-fr v-if="lang === 'fr-FR'" ref="changeLog" /> -->
|
|
|
|
<!-- <change-log-jp v-if="lang === 'jp'" ref="changeLog" /> -->
|
2020-08-13 15:18:26 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
2021-08-03 20:53:44 +08:00
|
|
|
// import ChangeLogCn from '../../CHANGELOG.zh-CN.md'
|
|
|
|
// import ChangeLogEs from '../../CHANGELOG.es.md'
|
2020-08-13 15:18:26 +08:00
|
|
|
import ChangeLogEn from '../../CHANGELOG.en-US.md'
|
2021-08-03 20:53:44 +08:00
|
|
|
// import ChangeLogFr from '../../CHANGELOG.fr-FR.md'
|
|
|
|
// import ChangeLogJp from '../../CHANGELOG.jp.md'
|
2020-08-13 15:18:26 +08:00
|
|
|
import pageLang from '../i18n/page.json'
|
|
|
|
export default {
|
|
|
|
components: {
|
2021-08-03 20:53:44 +08:00
|
|
|
// ChangeLogCn,
|
|
|
|
// ChangeLogEs,
|
2020-08-13 15:18:26 +08:00
|
|
|
ChangeLogEn,
|
2021-08-03 20:53:44 +08:00
|
|
|
// ChangeLogFr,
|
|
|
|
// ChangeLogJp,
|
2020-08-13 15:18:26 +08:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
lang: this.$route.meta.lang,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
langConfig() {
|
|
|
|
return pageLang.filter(config => config.lang === this.lang)[0].pages.changelog
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
const changeLog = this.$refs.changeLog
|
|
|
|
const changeLogNodes = changeLog.$el.children
|
|
|
|
let a = changeLogNodes[1].querySelector('a')
|
|
|
|
a && a.remove()
|
|
|
|
let release = changeLogNodes[1].textContent.trim()
|
2021-08-24 13:36:48 +08:00
|
|
|
let fragments = `<li><h3><a href="https://github.com/element-plus/element-plus/releases/tag/${release}" target="_blank">${release}</a></h3>`
|
2020-08-13 15:18:26 +08:00
|
|
|
|
|
|
|
for (let len = changeLogNodes.length, i = 2; i < len; i++) {
|
|
|
|
let node = changeLogNodes[i]
|
|
|
|
a = changeLogNodes[i].querySelector('a')
|
|
|
|
a && a.getAttribute('class') === 'header-anchor' && a.remove()
|
|
|
|
if (node.tagName !== 'H3') {
|
|
|
|
fragments += changeLogNodes[i].outerHTML
|
|
|
|
} else {
|
2021-08-24 13:36:48 +08:00
|
|
|
// removing ¶ from the texts.
|
|
|
|
release = changeLogNodes[i].textContent.slice(2).trim()
|
|
|
|
fragments += `</li><li><h3><a href="https://github.com/element-plus/element-plus/releases/tag/${release}" target="_blank">${release}</a></h3>`
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
|
|
|
}
|
2020-12-07 10:57:25 +08:00
|
|
|
fragments = fragments.replace(/#(\d+)/g, '<a href="https://github.com/element-plus/element-plus/issues/$1" target="_blank">#$1</a>')
|
2020-08-13 15:18:26 +08:00
|
|
|
fragments = fragments.replace(/@([\w-]+)/g, '<a href="https://github.com/$1" target="_blank">@$1</a>')
|
|
|
|
this.$refs.timeline.innerHTML = `${fragments}</li>`
|
|
|
|
|
|
|
|
changeLog.$el.remove()
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
2020-12-11 16:46:42 +08:00
|
|
|
<style lang="scss">
|
2020-08-13 15:18:26 +08:00
|
|
|
.page-changelog {
|
|
|
|
padding-bottom: 100px;
|
|
|
|
.fr {
|
|
|
|
float: right;
|
|
|
|
padding: 0;
|
|
|
|
&.el-button {
|
|
|
|
transform: translateY(-3px);
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
display: block;
|
|
|
|
padding: 10px 15px;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
&:hover a {
|
|
|
|
color: #409EFF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.heading {
|
|
|
|
font-size: 24px;
|
|
|
|
margin-bottom: 60px;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
.timeline {
|
|
|
|
padding: 0;
|
|
|
|
padding-bottom: 10px;
|
|
|
|
position: relative;
|
|
|
|
color: #5e6d82;
|
2020-12-02 11:43:12 +08:00
|
|
|
> li {
|
|
|
|
position: relative;
|
|
|
|
padding-bottom: 15px;
|
|
|
|
list-style: none;
|
|
|
|
line-height: 1.8;
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
border-radius: 4px;
|
|
|
|
&:not(:last-child) {
|
|
|
|
margin-bottom: 50px;
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
2020-12-02 11:43:12 +08:00
|
|
|
}
|
|
|
|
ul {
|
|
|
|
padding: 30px 30px 15px;
|
2020-08-13 15:18:26 +08:00
|
|
|
ul {
|
2020-12-02 11:43:12 +08:00
|
|
|
padding: 0;
|
|
|
|
padding-top: 5px;
|
|
|
|
padding-left: 27px;
|
|
|
|
li {
|
|
|
|
padding-left: 0;
|
|
|
|
color: #555;
|
|
|
|
word-break: normal;
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
2020-12-02 11:43:12 +08:00
|
|
|
li::before {
|
2020-08-13 15:18:26 +08:00
|
|
|
content: '';
|
2020-12-02 11:43:12 +08:00
|
|
|
circle: 4px #fff;
|
|
|
|
border: solid 1px #333;
|
|
|
|
margin-right: -12px;
|
2020-08-13 15:18:26 +08:00
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
}
|
2020-12-02 11:43:12 +08:00
|
|
|
}
|
|
|
|
li li {
|
|
|
|
font-size: 16px;
|
|
|
|
list-style: none;
|
|
|
|
padding-left: 20px;
|
|
|
|
padding-bottom: 5px;
|
|
|
|
color: #333;
|
|
|
|
word-break: break-all;
|
|
|
|
&:before {
|
|
|
|
content: '';
|
|
|
|
circle: 6px #333;
|
|
|
|
transform: translateX(-20px);
|
2020-08-13 15:18:26 +08:00
|
|
|
display: inline-block;
|
2020-12-02 11:43:12 +08:00
|
|
|
vertical-align: middle;
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
2020-12-02 11:43:12 +08:00
|
|
|
}
|
2020-08-13 15:18:26 +08:00
|
|
|
|
2020-12-02 11:43:12 +08:00
|
|
|
i {
|
|
|
|
padding: 0 20px;
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
h3 {
|
|
|
|
margin:0;
|
|
|
|
padding: 15px 30px;
|
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
|
font-size: 20px;
|
|
|
|
color: #333;
|
|
|
|
font-weight: bold;
|
|
|
|
a {
|
|
|
|
opacity: 1;
|
2020-08-13 15:18:26 +08:00
|
|
|
font-size: 20px;
|
2020-12-02 11:43:12 +08:00
|
|
|
float: none;
|
|
|
|
margin-left: 0;
|
2020-08-13 15:18:26 +08:00
|
|
|
color: #333;
|
|
|
|
}
|
2020-12-02 11:43:12 +08:00
|
|
|
}
|
|
|
|
h4 {
|
|
|
|
margin: 0;
|
|
|
|
margin-bottom: -10px;
|
|
|
|
font-size: 18px;
|
|
|
|
padding-left: 54px;
|
|
|
|
padding-top: 30px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
em {
|
|
|
|
position: absolute;
|
|
|
|
right: 30px;
|
|
|
|
font-style: normal;
|
|
|
|
top: 23px;
|
|
|
|
font-size: 16px;
|
|
|
|
color: #666;
|
|
|
|
}
|
2020-08-13 15:18:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|