Commit e5c22a7c authored by 杨奕's avatar 杨奕 Committed by cinwell.li

upgrade version (#2023)

parent b5e4994c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<div class="footer-main"> <div class="footer-main">
<p class="footer-main-title">Element 1.0 Hydrogen</p> <p class="footer-main-title">Element {{ version }} Hydrogen</p>
<a href="https://github.com/ElemeFE/element/issues" class="footer-main-link" target="_blank">{{ langConfig.feedback }}</a> <a href="https://github.com/ElemeFE/element/issues" class="footer-main-link" target="_blank">{{ langConfig.feedback }}</a>
<a href="https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md" class="footer-main-link" target="_blank">{{ langConfig.contribution }}</a> <a href="https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md" class="footer-main-link" target="_blank">{{ langConfig.contribution }}</a>
</div> </div>
...@@ -134,8 +134,15 @@ ...@@ -134,8 +134,15 @@
<script type="text/babel"> <script type="text/babel">
import compoLang from '../i18n/component.json'; import compoLang from '../i18n/component.json';
import { version } from 'main/index.js';
export default { export default {
data() {
return {
version
};
},
computed: { computed: {
lang() { lang() {
return this.$route.path.split('/')[1]; return this.$route.path.split('/')[1];
......
...@@ -163,6 +163,7 @@ ...@@ -163,6 +163,7 @@
</template> </template>
<script> <script>
import compoLang from '../i18n/component.json'; import compoLang from '../i18n/component.json';
import { version } from 'main/index.js';
export default { export default {
props: { props: {
...@@ -178,7 +179,7 @@ ...@@ -178,7 +179,7 @@
navState: [], navState: [],
isSmallScreen: false, isSmallScreen: false,
versions: [], versions: [],
version: '', version,
dropdownVisible: false dropdownVisible: false
}; };
}, },
...@@ -248,13 +249,6 @@ ...@@ -248,13 +249,6 @@
xhr.onreadystatechange = _ => { xhr.onreadystatechange = _ => {
if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.readyState === 4 && xhr.status === 200) {
this.versions = JSON.parse(xhr.responseText); this.versions = JSON.parse(xhr.responseText);
const pathname = location.pathname.replace(/\//, '');
if (pathname.length > 0) {
this.version = pathname;
} else {
const versionArr = Object.keys(this.versions);
this.version = versionArr[versionArr.length - 1];
}
} }
}; };
xhr.open('GET', '/versions.json'); xhr.open('GET', '/versions.json');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment