diff --git a/src/pages/test.vue b/src/pages/test.vue index f3c8064..8970497 100644 --- a/src/pages/test.vue +++ b/src/pages/test.vue @@ -5,6 +5,7 @@ import {onMounted, onUnmounted, ref, watch} from "vue"; import store from "../store/index.js"; import swal from "../utils/sweetalert.js"; import getCurrentTime from "../utils/getCurrentTime.js"; +import mobileTest from "../utils/mobileTest.js"; const contentInput = ref(store.state.editStore.blog || ''); const titleInput = ref(store.state.editStore.blogTitle || '') @@ -124,7 +125,7 @@ onUnmounted(() => {
-
+
@@ -141,7 +142,7 @@ onUnmounted(() => {
-
+
diff --git a/src/utils/mobileTest.js b/src/utils/mobileTest.js new file mode 100644 index 0000000..142ffc5 --- /dev/null +++ b/src/utils/mobileTest.js @@ -0,0 +1,4 @@ +export default function mobileTest() { + const userAgent = navigator.userAgent.toLowerCase(); + return /mobile/i.test(userAgent) || /android/i.test(userAgent) || /iphone/i.test(userAgent); +} \ No newline at end of file