Commit 7ebcda48 authored by 何毅恒's avatar 何毅恒

c

parent 369d2aa8
<script setup lang="ts">
// import { onMounted, computed } from "vue";
// import { useRouter } from "vue-router";
// onMounted(() => {
// detectDeviceType(machineType.value);
......
......@@ -5,9 +5,11 @@
<script lang="ts" setup>
import { onMounted } from "vue";
import { useRouter } from "vue-router";
onMounted(() => {
detectDeviceType();
});
const router = useRouter();
const detectDeviceType = (): void => {
const machineType =
......@@ -17,9 +19,9 @@ const detectDeviceType = (): void => {
? "Mobile"
: "Desktop";
if (machineType == "Mobile") {
router.push("/mobile");
router.replace("/mobile");
} else {
router.push("/pc");
router.replace("/pc");
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment