feat(cli): support switch lang

This commit is contained in:
陈嘉涵
2019-12-09 16:24:25 +08:00
parent e461a80dbe
commit cf172f5cbc
7 changed files with 61 additions and 26 deletions

View File

@@ -9,7 +9,8 @@ export default {
name: 'van-doc-simulator',
props: {
src: String
src: String,
lang: String
},
data() {
@@ -32,6 +33,12 @@ export default {
}
},
watch: {
lang(val) {
location.hash = `#${location.hash.replace(this.lang, val)}`;
}
},
mounted() {
window.addEventListener('scroll', () => {
this.scrollTop = window.scrollY;