Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-08-30 10:20:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
09b69b1f70f184359706a80208b43bdb49443e3f
09b69b1f
1 parent
867e7519
✨ feat: 细节调整,判断PC端访问适配
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
25 deletions
.env
src/App.vue
src/main.js
src/utils/tools.js
.env
View file @
09b69b1
# port
VITE_PORT = 8
1
08
VITE_PORT = 8
2
08
# 反向代理服务器地址
# VITE_PROXY_TARGET = http://voice.onwall.cn
...
...
src/App.vue
View file @
09b69b1
...
...
@@ -2,18 +2,17 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-26 23:52:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-08-
29 14:00:58
* @LastEditTime: 2022-08-
30 06:13:04
* @FilePath: /data-table/src/App.vue
* @Description:
-->
<template>
<!-- 页面缓存 -->
<!-- <router-view v-slot="{ Component, route }">
<keep-alive :include="keepPages" :max="10">
<component :is="Component" :key="route.name" />
</keep-alive>
</router-view> -->
<router-view></router-view>
<van-row v-if="is_pc">
<van-col span="10" offset="7">
<router-view></router-view>
</van-col>
</van-row>
<router-view v-else></router-view>
</template>
<script setup>
...
...
@@ -36,9 +35,9 @@ const keepPages = computed(() => store.getKeepPages)
// // TAG: 全局设置页面标题
// const $route = useRoute();
//
watchEffect(
// () => useTitle($route.meta.title
)
//
)
watchEffect(
() => useTitle('表单标题'
)
)
// 监听路由变化
// 切换路由页面返回顶部
const $router = useRouter();
...
...
@@ -55,12 +54,10 @@ Toast.setDefaultOptions({
className: 'zIndex'
});
// web端判断
const is_pc = computed(() => wxInfo().isPC)
onMounted(async () => {
// web端访问跳转
// const url = import.meta.env.VITE_MOBILE_URL;
// if (!wxInfo().isMobile && !wxInfo().isWeiXin) {
// location.href = url + location.hash;
// }
// const { data } = await wxJsAPI();
// data.jsApiList = apiList;
// wx.config(data);
...
...
@@ -81,6 +78,7 @@ body {
width: 100%;
height: 100%;
color: @base-font-color;
background-color: #F7F8FA;
}
body {
...
...
src/main.js
View file @
09b69b1
...
...
@@ -2,12 +2,12 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-31 12:06:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-0
7-21 11:37:32
* @FilePath: /
front
/src/main.js
* @Description:
* @LastEditTime: 2022-0
8-29 16:44:15
* @FilePath: /
data-table
/src/main.js
* @Description:
*/
import
{
createApp
}
from
'vue'
;
import
{
Button
,
Image
as
VanImage
,
Col
,
Row
,
Icon
,
Form
,
Field
,
CellGroup
,
ConfigProvider
,
Toast
,
Uploader
,
Empty
,
Tab
,
Tabs
,
Overlay
,
NumberKeyboard
,
Lazyload
,
List
,
PullRefresh
,
Popup
,
Picker
,
Sticky
,
Stepper
,
Tag
,
Swipe
,
SwipeItem
,
Dialog
,
ActionSheet
,
Loading
,
Checkbox
,
Search
,
NavBar
,
Collapse
,
CollapseItem
}
from
'vant'
;
import
{
Button
,
Image
as
VanImage
,
Col
,
Row
,
Icon
,
Form
,
Field
,
CellGroup
,
ConfigProvider
,
Toast
,
Uploader
,
Empty
,
Tab
,
Tabs
,
Overlay
,
NumberKeyboard
,
Lazyload
,
List
,
PullRefresh
,
Popup
,
Picker
,
Sticky
,
Stepper
,
Tag
,
Swipe
,
SwipeItem
,
Dialog
,
ActionSheet
,
Loading
,
Checkbox
,
Search
,
NavBar
,
Collapse
,
CollapseItem
,
RadioGroup
,
Radio
}
from
'vant'
;
import
router
from
'./router'
;
import
App
from
'./App.vue'
;
// import axios from './utils/axios';
...
...
@@ -18,8 +18,11 @@ import { createPinia } from 'pinia';
const
pinia
=
createPinia
();
const
app
=
createApp
(
App
);
// 屏蔽警告信息
app
.
config
.
warnHandler
=
()
=>
null
;
app
.
config
.
globalProperties
.
$http
=
axios
;
// 关键语句
app
.
use
(
pinia
).
use
(
router
).
use
(
Button
).
use
(
VanImage
).
use
(
Col
).
use
(
Row
).
use
(
Icon
).
use
(
Form
).
use
(
Field
).
use
(
CellGroup
).
use
(
Toast
).
use
(
Uploader
).
use
(
Empty
).
use
(
Tab
).
use
(
Tabs
).
use
(
Overlay
).
use
(
NumberKeyboard
).
use
(
Lazyload
).
use
(
List
).
use
(
PullRefresh
).
use
(
Popup
).
use
(
Picker
).
use
(
Sticky
).
use
(
Stepper
).
use
(
Tag
).
use
(
Swipe
).
use
(
SwipeItem
).
use
(
Dialog
).
use
(
ActionSheet
).
use
(
Loading
).
use
(
Checkbox
).
use
(
Search
).
use
(
ConfigProvider
).
use
(
NavBar
).
use
(
Collapse
).
use
(
CollapseItem
);
app
.
use
(
pinia
).
use
(
router
).
use
(
Button
).
use
(
VanImage
).
use
(
Col
).
use
(
Row
).
use
(
Icon
).
use
(
Form
).
use
(
Field
).
use
(
CellGroup
).
use
(
Toast
).
use
(
Uploader
).
use
(
Empty
).
use
(
Tab
).
use
(
Tabs
).
use
(
Overlay
).
use
(
NumberKeyboard
).
use
(
Lazyload
).
use
(
List
).
use
(
PullRefresh
).
use
(
Popup
).
use
(
Picker
).
use
(
Sticky
).
use
(
Stepper
).
use
(
Tag
).
use
(
Swipe
).
use
(
SwipeItem
).
use
(
Dialog
).
use
(
ActionSheet
).
use
(
Loading
).
use
(
Checkbox
).
use
(
Search
).
use
(
ConfigProvider
).
use
(
NavBar
).
use
(
Collapse
).
use
(
CollapseItem
)
.
use
(
Radio
).
use
(
RadioGroup
)
;
app
.
mount
(
'#app'
);
...
...
src/utils/tools.js
View file @
09b69b1
/*
* @Date: 2022-04-18 15:59:42
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-08-2
3 13:37:06
* @FilePath: /
front
/src/utils/tools.js
* @LastEditTime: 2022-08-2
9 16:13:49
* @FilePath: /
data-table
/src/utils/tools.js
* @Description: 文件描述
*/
import
dayjs
from
'dayjs'
;
...
...
@@ -24,12 +24,14 @@ const wxInfo = () => {
let
isIpad
=
u
.
indexOf
(
'iPad'
)
>
-
1
;
// iPad平台
let
uAgent
=
navigator
.
userAgent
.
toLowerCase
();
let
isWeiXin
=
(
uAgent
.
match
(
/MicroMessenger/i
)
==
'micromessenger'
)
?
true
:
false
;
let
isPC
=
(
uAgent
.
match
(
/
(
phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone
)
/i
))
?
false
:
true
;
return
{
isAndroid
,
isiOS
,
isWeiXin
,
isMobile
,
isIpad
isIpad
,
isPC
};
};
...
...
Please
register
or
login
to post a comment