feat(cli): support custom simulator (#8499)

This commit is contained in:
neverland
2021-04-10 17:01:09 +08:00
committed by GitHub
parent 3ddfe3bbb4
commit 16ff1ba9a7
6 changed files with 35 additions and 10 deletions

View File

@@ -25,15 +25,20 @@ export default {
},
data() {
const path = location.pathname.replace(/\/index(\.html)?/, '/');
return {
simulator: `${path}mobile.html${location.hash}`,
hasSimulator: true,
};
},
computed: {
simulator() {
if (config.site.simulator?.url) {
return config.site.simulator?.url;
}
const path = location.pathname.replace(/\/index(\.html)?/, '/');
return `${path}mobile.html${location.hash}`;
},
lang() {
const { lang } = this.$route.meta;
return lang || '';