Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gl_help
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
gl_help
Commits
7ebcda48
Commit
7ebcda48
authored
Aug 11, 2023
by
何毅恒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c
parent
369d2aa8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/App.vue
src/App.vue
+0
-1
src/pages/index.vue
src/pages/index.vue
+4
-2
No files found.
src/App.vue
View file @
7ebcda48
<
script
setup
lang=
"ts"
>
// import { onMounted, computed } from "vue";
// import { useRouter } from "vue-router";
// onMounted(() => {
// detectDeviceType(machineType.value);
...
...
src/pages/index.vue
View file @
7ebcda48
...
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment