mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-01-20 16:53:37 +08:00
fix: 修复this.$storage类型报错
This commit is contained in:
15
src/App.vue
15
src/App.vue
@@ -7,8 +7,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "vue";
|
import { useGlobal } from "@pureadmin/utils";
|
||||||
import { checkVersion } from "version-rocket";
|
import { checkVersion } from "version-rocket";
|
||||||
|
import { defineComponent, computed } from "vue";
|
||||||
import { ElConfigProvider } from "element-plus";
|
import { ElConfigProvider } from "element-plus";
|
||||||
import { ReDialog } from "@/components/ReDialog";
|
import { ReDialog } from "@/components/ReDialog";
|
||||||
import { ReDrawer } from "@/components/ReDrawer";
|
import { ReDrawer } from "@/components/ReDrawer";
|
||||||
@@ -24,12 +25,16 @@ export default defineComponent({
|
|||||||
ReDialog,
|
ReDialog,
|
||||||
ReDrawer
|
ReDrawer
|
||||||
},
|
},
|
||||||
computed: {
|
setup() {
|
||||||
currentLocale() {
|
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||||
return this.$storage.locale?.locale === "zh"
|
const currentLocale = computed(() => {
|
||||||
|
return $storage.locale?.locale === "zh"
|
||||||
? { ...zhCn, ...plusZhCn }
|
? { ...zhCn, ...plusZhCn }
|
||||||
: { ...en, ...plusEn };
|
: { ...en, ...plusEn };
|
||||||
}
|
});
|
||||||
|
return {
|
||||||
|
currentLocale
|
||||||
|
};
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
const { version, name: title } = __APP_INFO__.pkg;
|
const { version, name: title } = __APP_INFO__.pkg;
|
||||||
|
|||||||
Reference in New Issue
Block a user