fix: 修复this.$storage类型报错

This commit is contained in:
xiaoxian521
2026-01-15 09:12:55 +08:00
parent f3756089fd
commit 4c3ad7acce

View File

@@ -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;