Browse Source

fix: change mobile jump bug

richard1015 3 years ago
parent
commit
a93feb00b5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/sites/doc/main.ts

+ 2 - 1
src/sites/doc/main.ts

@@ -10,7 +10,8 @@ import NutUI from '@/packages/nutui.vue';
 import { isMobile } from '@/sites/assets/util';
 import { isMobile } from '@/sites/assets/util';
 
 
 if (isMobile) {
 if (isMobile) {
-  location.replace('demo.html' + location.hash);
+  let url = location.hash.replace('/zh-CN/', '').replace('/en-US/', '');
+  location.replace('demo.html' + url);
 }
 }
 
 
 createApp(App).directive('hover', Hover).component('demo-block', DemoBlock).use(router).use(NutUI).mount('#doc');
 createApp(App).directive('hover', Hover).component('demo-block', DemoBlock).use(router).use(NutUI).mount('#doc');