update 重构 彻底删除proxy用法 改为vue3官方推荐写法

This commit is contained in:
疯狂的狮子Li
2026-04-10 13:07:37 +08:00
parent eb62402423
commit 9acf52e8a7
144 changed files with 1264 additions and 1082 deletions

View File

@@ -20,17 +20,19 @@
</template>
<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router';
import errImage from '@/assets/401_images/401.gif';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const router = useRouter();
const errGif = ref(errImage + '?' + +new Date());
function back() {
if (proxy?.$route.query.noGoBack) {
proxy.$router.push({ path: '/' });
if (route.query.noGoBack) {
router.push({ path: '/' });
} else {
proxy?.$router.go(-1);
router.go(-1);
}
}
</script>