feat(cli): support custom simulator (#8499)
This commit is contained in:
@@ -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 || '';
|
||||
|
||||
@@ -214,7 +214,7 @@ export default {
|
||||
position: absolute;
|
||||
top: 34px;
|
||||
left: 0;
|
||||
width: 100px;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
color: #333;
|
||||
line-height: 36px;
|
||||
|
||||
@@ -120,6 +120,8 @@ router.afterEach(() => {
|
||||
nextTick(syncPathToChild);
|
||||
});
|
||||
|
||||
listenToSyncPath(router);
|
||||
if (config.site.simulator?.syncPathFromSimulator !== false) {
|
||||
listenToSyncPath(router);
|
||||
}
|
||||
|
||||
window.vueRouter = router;
|
||||
|
||||
Reference in New Issue
Block a user