mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-03-16 22:10:27 +00:00
redirect to old documentation versions
This commit is contained in:
parent
38e6176c1e
commit
3c9ec8d86e
1 changed files with 17 additions and 3 deletions
|
|
@ -77,17 +77,31 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
import versions from '../../../versions.json';
|
||||
|
||||
versions.sort((a, b) => a < b);
|
||||
|
||||
const latest = versions[0];
|
||||
|
||||
export default {
|
||||
props: {
|
||||
pageTitle: String
|
||||
},
|
||||
data: () => ({
|
||||
currentDocs: '0.4.0',
|
||||
availableDocs: ['0.4.0', '0.3.0']
|
||||
latest: latest,
|
||||
currentDocs: latest,
|
||||
availableDocs: versions
|
||||
}),
|
||||
methods: {
|
||||
changeDocs() {
|
||||
console.log(this.currentDocs);
|
||||
const location = window.location;
|
||||
const redirect = location.origin + '/vue-material/';
|
||||
|
||||
if (this.currentDocs === this.latest) {
|
||||
window.location.href = redirect + location.hash;
|
||||
} else {
|
||||
window.location.href = redirect + 'v' + this.currentDocs + '/' + location.hash;
|
||||
}
|
||||
},
|
||||
toggleSidenav() {
|
||||
this.$root.toggleSidenav();
|
||||
|
|
|
|||
Loading…
Reference in a new issue