Skip to content

Commit 07d4a29

Browse files
authored
fix(dev2): when run dev2, fix the mode value (opentiny#673)
1 parent d9c8a15 commit 07d4a29

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

examples/vue2.7/src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import VueI18n from 'vue-i18n'
44
import { initI18n } from '@opentiny/vue-locale'
55
import { Loading } from '@opentiny/vue'
66
import App from '@/App.vue'
7-
import { $local } from '@/uses'
87

9-
const mode = $local.mode || 'pc'
8+
const mode = location.pathname.split('/')[1] || 'pc'
109

1110
Vue.prototype.tiny_mode = { value: mode }
1211
Vue.prototype.isPcMode = mode === 'pc'

examples/vue2/src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import VueI18n from 'vue-i18n'
44
import { initI18n } from '@opentiny/vue-locale'
55
import { Loading } from '@opentiny/vue'
66
import App from '@/App.vue'
7-
import { $local } from '@/uses'
87

98
Vue.config.productionTip = false
10-
const mode = $local.mode || 'pc'
9+
const mode = location.pathname.split('/')[1] || 'pc'
1110

1211
Vue.prototype.tiny_mode = { value: mode }
1312
Vue.prototype.isPcMode = mode === 'pc'

0 commit comments

Comments
 (0)