diff --git a/examples/vue2.7/src/main.ts b/examples/vue2.7/src/main.ts index bc9c11b60..c56b51234 100644 --- a/examples/vue2.7/src/main.ts +++ b/examples/vue2.7/src/main.ts @@ -4,9 +4,8 @@ import VueI18n from 'vue-i18n' import { initI18n } from '@opentiny/vue-locale' import { Loading } from '@opentiny/vue' import App from '@/App.vue' -import { $local } from '@/uses' -const mode = $local.mode || 'pc' +const mode = location.pathname.split('/')[1] || 'pc' Vue.prototype.tiny_mode = { value: mode } Vue.prototype.isPcMode = mode === 'pc' diff --git a/examples/vue2/src/main.ts b/examples/vue2/src/main.ts index 58dbd2e5d..a06aaf246 100644 --- a/examples/vue2/src/main.ts +++ b/examples/vue2/src/main.ts @@ -4,10 +4,9 @@ import VueI18n from 'vue-i18n' import { initI18n } from '@opentiny/vue-locale' import { Loading } from '@opentiny/vue' import App from '@/App.vue' -import { $local } from '@/uses' Vue.config.productionTip = false -const mode = $local.mode || 'pc' +const mode = location.pathname.split('/')[1] || 'pc' Vue.prototype.tiny_mode = { value: mode } Vue.prototype.isPcMode = mode === 'pc'