develop:开发独立页面
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -1,17 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- html -->
|
<!-- html -->
|
||||||
<content></content>
|
<!-- <content></content> -->
|
||||||
|
<router-view />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// JS或TS
|
// JS或TS
|
||||||
import Content from './components/Content.vue'
|
import Content from './components/Content.vue';
|
||||||
|
import SinglePage from './SinglePage.vue';
|
||||||
|
|
||||||
export default{
|
export default{
|
||||||
//组件名
|
//组件名
|
||||||
name:'App',
|
name:'App',
|
||||||
// 注册组件
|
// 注册组件
|
||||||
components:{
|
components:{
|
||||||
Content
|
Content,
|
||||||
|
SinglePage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
59
src/SinglePage.vue
Normal file
59
src/SinglePage.vue
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div class="common-layout">
|
||||||
|
<el-container>
|
||||||
|
<el-main style="padding: 0;" :style="{ zoom: scaleva }">
|
||||||
|
<RouterView></RouterView>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="Content">
|
||||||
|
import { RouterView } from 'vue-router'
|
||||||
|
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
const scaleva = ref();
|
||||||
|
|
||||||
|
const isPC = (userAgent = navigator.userAgent) => {
|
||||||
|
const ua = userAgent.toLowerCase();
|
||||||
|
// 移动设备关键词(优先排除)
|
||||||
|
const mobilePattern = /android|iphone|ipad|ipod|windows phone|blackberry|symbian|mobile|tablet|touch|fennec|ucbrowser mini|opera mobi/i;
|
||||||
|
// 若包含移动设备特征,直接返回false
|
||||||
|
if (mobilePattern.test(ua)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// PC设备操作系统关键词
|
||||||
|
const pcPattern = /windows nt|macintosh|linux x86_64|freebsd|openbsd/i;
|
||||||
|
// 验证是否包含PC特征
|
||||||
|
return pcPattern.test(ua);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const bodyScale = () => {
|
||||||
|
const devicewidth = document.documentElement.clientWidth// 获取当前分辨率下的可是区域宽度
|
||||||
|
const scale = devicewidth / 1920 // 分母——设计稿的尺寸
|
||||||
|
scaleva.value = scale
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
if (isPC()) {
|
||||||
|
bodyScale()
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
bodyScale()
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.headerCss {
|
||||||
|
background-color: $title-background-color;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "recruitment",
|
name: "recruitment",
|
||||||
type: '/joblist'
|
type: '/job/joblist'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "problem",
|
name: "problem",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import en from './en.json';
|
import en from './en.json';
|
||||||
import zh from './zh.json';
|
import zh from './zh.json';
|
||||||
import th from './th.json';
|
// import th from './th.json';
|
||||||
export interface Messages {
|
export interface Messages {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,7 @@ export interface Messages {
|
|||||||
const messages: Messages = {
|
const messages: Messages = {
|
||||||
en,
|
en,
|
||||||
zh,
|
zh,
|
||||||
th
|
// th
|
||||||
};
|
};
|
||||||
|
|
||||||
export default messages;
|
export default messages;
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import Home from '@/components/Home.vue';
|
|||||||
import Service from '@/components/Service.vue';
|
import Service from '@/components/Service.vue';
|
||||||
import Contact from '@/components/Contact.vue';
|
import Contact from '@/components/Contact.vue';
|
||||||
import Problem from '@/components/Problem.vue';
|
import Problem from '@/components/Problem.vue';
|
||||||
|
import SinglePage from "@/SinglePage.vue";
|
||||||
|
import Content from "@/components/Content.vue";
|
||||||
import JobList from "@/pages/H5/Join/JobList.vue";
|
import JobList from "@/pages/H5/Join/JobList.vue";
|
||||||
import JobDetail from "@/pages/H5/Join/JobDetail.vue";
|
import JobDetail from "@/pages/H5/Join/JobDetail.vue";
|
||||||
|
|
||||||
@@ -16,37 +18,38 @@ import JobDetail from "@/pages/H5/Join/JobDetail.vue";
|
|||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
component: Content,
|
||||||
|
children: [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Home
|
component: Home
|
||||||
},
|
},
|
||||||
{
|
]
|
||||||
path:'/NavContainer',
|
|
||||||
component:NavContainer
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path:'/Preson',
|
path: '/job',
|
||||||
component:Preson
|
component: SinglePage,
|
||||||
},
|
children: [
|
||||||
{
|
{
|
||||||
path:'/Service',
|
path: '/job/joblist',
|
||||||
component:Service
|
component: JobList,
|
||||||
},
|
meta: {
|
||||||
{
|
h5: true
|
||||||
path:'/Contact',
|
}
|
||||||
component:Contact
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path:'/Problem',
|
|
||||||
component:Problem
|
|
||||||
}, {
|
|
||||||
path:'/joblist',
|
|
||||||
component: JobList
|
|
||||||
}, {
|
}, {
|
||||||
path: '/jobdetail',
|
path: '/jobdetail',
|
||||||
component: JobDetail
|
component: JobDetail,
|
||||||
|
meta: {
|
||||||
|
h5: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
Reference in New Issue
Block a user