Skip to content

Commit 36203a7

Browse files
committed
add rc version selecting
1 parent acfbebf commit 36203a7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

themes/vue/layout/partials/sidebar.ejs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
1919
<% } %>
2020
<select class="version-select">
21+
<option value="rc">2.0-rc</option>
2122
<option selected>1.0</option>
2223
<option>0.12</option>
2324
</select>

themes/vue/source/js/common.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
// version select
5555
document.querySelector('.version-select').addEventListener('change', function (e) {
5656
var version = e.target.value
57-
if (version.indexOf('1.') !== 0) {
57+
if (version.indexOf('rc') === 0) {
58+
var section = window.location.pathname.match(/\/(\w+?)\//)[1]
59+
window.location.assign('http://rc.vuejs.org/' + section + '/')
60+
} else if (version.indexOf('1.') !== 0) {
5861
version = version.replace('.', '')
5962
var section = window.location.pathname.match(/\/(\w+?)\//)[1]
6063
window.location.assign('http://' + version + '-jp.vuejs.org/' + section + '/')

0 commit comments

Comments
 (0)