perf: perf style (#89)

perf: perf style
This commit is contained in:
一万 2021-10-31 20:24:57 +08:00 committed by GitHub
parent 0fb7b5e983
commit 9ddf449ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 161 additions and 166 deletions

View File

@ -111,7 +111,7 @@ let classOption = reactive({
.warp { .warp {
width: 95%; width: 95%;
height: 230px; height: 215px;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;

View File

@ -28,7 +28,7 @@ let map: MapConfigureInter;
const instance = getCurrentInstance(); const instance = getCurrentInstance();
const mapSet: mapInter = reactive({ const mapSet = reactive({
loading: deviceDetection() ? false : true loading: deviceDetection() ? false : true
}); });
@ -138,7 +138,7 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
#mapview { #mapview {
height: 100vh; height: calc(100vh - 86px);
} }
:deep(.amap-marker-label) { :deep(.amap-marker-label) {

View File

@ -74,9 +74,18 @@ const transitionMain = defineComponent({
v-if="keepAlive" v-if="keepAlive"
:include="usePermissionStoreHook().cachePageList" :include="usePermissionStoreHook().cachePageList"
> >
<component :is="Component" :key="route.fullPath" /> <component
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</keep-alive> </keep-alive>
<component v-else :is="Component" :key="route.fullPath" /> <component
v-else
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</transitionMain> </transitionMain>
</el-scrollbar> </el-scrollbar>
<div v-else> <div v-else>
@ -85,9 +94,18 @@ const transitionMain = defineComponent({
v-if="keepAlive" v-if="keepAlive"
:include="usePermissionStoreHook().cachePageList" :include="usePermissionStoreHook().cachePageList"
> >
<component :is="Component" :key="route.fullPath" /> <component
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</keep-alive> </keep-alive>
<component v-else :is="Component" :key="route.fullPath" /> <component
v-else
:is="Component"
:key="route.fullPath"
class="main-content"
/>
</transitionMain> </transitionMain>
</div> </div>
</template> </template>
@ -108,4 +126,8 @@ const transitionMain = defineComponent({
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
} }
.main-content {
margin: 24px;
}
</style> </style>

View File

@ -65,11 +65,6 @@ ul {
} }
} }
// main-container global css
.app-container {
padding: 20px;
}
.login, .login,
.register { .register {
width: 100vw; width: 100vw;

View File

@ -33,6 +33,7 @@
transition: margin-left 0.28s; transition: margin-left 0.28s;
margin-left: $sideBarWidth; margin-left: $sideBarWidth;
position: relative; position: relative;
background: #f0f2f5;
@media screen and (min-width: 150px) and (max-width: 420px) { @media screen and (min-width: 150px) and (max-width: 420px) {
.app-main .el-scrollbar__view:first-child { .app-main .el-scrollbar__view:first-child {
overflow-y: hidden; overflow-y: hidden;

View File

@ -5,7 +5,7 @@ import menuDynamic from "./menuDynamic.vue";
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="10"> <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="10">
<!-- 基本使用 --> <!-- 基本使用 -->

View File

@ -3,7 +3,7 @@ import { ReNormalCountTo, ReboundCountTo } from "/@/components/ReCountTo";
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<el-card shadow="always"> <el-card shadow="always">

View File

@ -25,7 +25,7 @@ const onCropper = (): void => {
</script> </script>
<template> <template>
<div style="margin: 10px"> <div>
<div class="cropper-container"> <div class="cropper-container">
<Cropper ref="refCropper" :width="'40vw'" :src="img" /> <Cropper ref="refCropper" :width="'40vw'" :src="img" />
<img :src="cropperImg" class="croppered" v-if="cropperImg" /> <img :src="cropperImg" class="croppered" v-if="cropperImg" />

View File

@ -3,14 +3,11 @@ import { Amap } from "/@/components/ReMap";
</script> </script>
<template> <template>
<div class="map"> <Amap />
<Amap />
</div>
</template> </template>
<style scoped> <style scoped>
.map { .main-content {
width: 100%; margin: 0;
height: 89vh;
} }
</style> </style>

View File

@ -110,10 +110,6 @@ function changeDirection(val) {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.box-card {
margin: 10px;
}
.card-header { .card-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

View File

@ -23,12 +23,7 @@ const selectedVal = ({ left, right }): void => {
<template> <template>
<div> <div>
<el-card <el-card class="box-card" v-for="(item, key) in dataLists" :key="key">
class="box-card"
style="margin: 10px"
v-for="(item, key) in dataLists"
:key="key"
>
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>{{ item.title }}</span> <span>{{ item.title }}</span>
@ -44,3 +39,9 @@ const selectedVal = ({ left, right }): void => {
</el-card> </el-card>
</div> </div>
</template> </template>
<style scoped>
.el-card {
margin-bottom: 10px;
}
</style>

View File

@ -41,12 +41,11 @@ const settingTB: ContextProps = reactive({
<style lang="scss" scoped> <style lang="scss" scoped>
$W: 100%; $W: 100%;
$H: 80vh; $H: 70vh;
.split-pane { .split-pane {
width: 98%; width: 70vw;
height: $H; height: $H;
margin-top: 5px;
text-align: center; text-align: center;
font-size: 50px; font-size: 50px;
color: #fff; color: #fff;

View File

@ -86,9 +86,8 @@ onMounted(() => {
<style scoped> <style scoped>
#LF-Turbo { #LF-Turbo {
width: 100vw; width: 100%;
height: 88.5vh; height: calc(100vh - 90px);
outline: none;
} }
.logic-flow-view { .logic-flow-view {
@ -138,4 +137,8 @@ onMounted(() => {
height: 85vh; height: 85vh;
overflow: auto; overflow: auto;
} }
.main-content {
margin: 0;
}
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div>
<p>{{ $t("message.hsmenu1") }}</p> <p>{{ $t("message.hsmenu1") }}</p>
<router-view> <router-view>
<template #default="{ Component, route }"> <template #default="{ Component, route }">

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div>
<p>{{ $t("message.hsmenu2") }}</p> <p>{{ $t("message.hsmenu2") }}</p>
<el-input v-model="input" /> <el-input v-model="input" />
</div> </div>

View File

@ -14,7 +14,7 @@ function changRole(value) {
</script> </script>
<template> <template>
<div class="app-container"> <div>
<el-radio-group v-model="auth" @change="changRole"> <el-radio-group v-model="auth" @change="changRole">
<el-radio-button label="admin"></el-radio-button> <el-radio-button label="admin"></el-radio-button>
<el-radio-button label="test"></el-radio-button> <el-radio-button label="test"></el-radio-button>

View File

@ -22,7 +22,7 @@ function changRole() {
</script> </script>
<template> <template>
<div class="app-container"> <div>
<h4> <h4>
当前角色 当前角色
<span style="font-size: 26px">{{ purview }}</span> <span style="font-size: 26px">{{ purview }}</span>

View File

@ -197,7 +197,7 @@ function handleClose() {
</script> </script>
<template> <template>
<div class="dict-container"> <div>
<!-- 工具栏 --> <!-- 工具栏 -->
<vxe-toolbar> <vxe-toolbar>
<template #buttons> <template #buttons>
@ -309,10 +309,6 @@ function handleClose() {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.dict-container {
margin: 10px;
}
.vxe-input + .vxe-button, .vxe-input + .vxe-button,
.vxe-input + .vxe-button--dropdown, .vxe-input + .vxe-button--dropdown,
.vxe-button + .vxe-button, .vxe-button + .vxe-button,
@ -324,6 +320,14 @@ function handleClose() {
border-radius: 0; border-radius: 0;
} }
.vxe-toolbar.size--medium {
padding: 10px;
}
.vxe-table--render-default.size--medium {
margin-top: 12px;
}
.vxe-button.size--medium.type--button { .vxe-button.size--medium.type--button {
margin-right: 0.07em; margin-right: 0.07em;
} }

View File

@ -6,7 +6,7 @@ const gridOptions = reactive({
border: true, border: true,
resizable: true, resizable: true,
keepSource: true, keepSource: true,
height: 500, height: 578,
printConfig: {}, printConfig: {},
importConfig: {}, importConfig: {},
exportConfig: {}, exportConfig: {},
@ -162,33 +162,6 @@ const gridOptions = reactive({
sex: "Man ", sex: "Man ",
age: 35, age: 35,
address: "Guangzhou" address: "Guangzhou"
},
{
id: 100011,
name: "Test11",
nickname: "T11",
role: "Test",
sex: "Women ",
age: 26,
address: "vxe-table 从入门到放弃"
},
{
id: 100012,
name: "Test12",
nickname: "T12",
role: "Develop",
sex: "Man ",
age: 34,
address: "Guangzhou"
},
{
id: 100013,
name: "Test13",
nickname: "T13",
role: "Test",
sex: "Women ",
age: 22,
address: "Shenzhen"
} }
]; ];
resolve({ resolve({
@ -238,5 +211,5 @@ const gridOptions = reactive({
</script> </script>
<template> <template>
<vxe-grid v-bind="gridOptions" style="width: 98%"></vxe-grid> <vxe-grid v-bind="gridOptions"></vxe-grid>
</template> </template>

View File

@ -6,12 +6,10 @@ import {
ReLine, ReLine,
ReBar ReBar
} from "/@/components/ReCharts/index"; } from "/@/components/ReCharts/index";
import { useAppStoreHook } from "/@/store/modules/app"; import { ref, computed } from "vue";
import { ref, shallowRef, computed, onBeforeMount } from "vue";
const date: Date = new Date(); const date: Date = new Date();
let loading = ref<boolean>(true); let loading = ref<boolean>(true);
const componentList = shallowRef([]);
setTimeout(() => { setTimeout(() => {
loading.value = !loading.value; loading.value = !loading.value;
@ -27,56 +25,6 @@ let greetings = computed(() => {
} }
}); });
onBeforeMount(() => {
if (useAppStoreHook().device === "mobile") {
componentList.value = [
{
width: "20em",
title: "GitHub饼图信息",
component: RePie
},
{
width: "20em",
title: "GitHub折线图信息",
component: ReLine
},
{
width: "20em",
title: "GitHub柱状图信息",
component: ReBar
}
];
} else {
componentList.value = [
{
width: "43em",
title: "GitHub信息",
component: ReGithub
},
{
width: "43em",
title: "GitHub滚动信息",
component: ReInfinite
},
{
width: "28.28em",
title: "GitHub饼图信息",
component: RePie
},
{
width: "28.28em",
title: "GitHub折线图信息",
component: ReLine
},
{
width: "28.28em",
title: "GitHub柱状图信息",
component: ReBar
}
];
}
});
const openDepot = (): void => { const openDepot = (): void => {
window.open("https://github.com/xiaoxian521/vue-pure-admin"); window.open("https://github.com/xiaoxian521/vue-pure-admin");
}; };
@ -95,27 +43,97 @@ const openDepot = (): void => {
</div> </div>
</el-card> </el-card>
<el-space class="space" wrap size="large"> <el-row :gutter="24" style="margin: 20px">
<el-skeleton <el-col
v-for="(item, key) in componentList" :xs="24"
:key="key" :sm="12"
animated :md="12"
:rows="7" :lg="12"
:loading="loading" :xl="12"
:class="$style.size" style="margin-bottom: 20px"
:style="{ width: item.width }"
> >
<template #default> <el-skeleton animated :rows="7" :loading="false">
<div <template #default>
:class="['echart-card', $style.size]" <el-card>
:style="{ width: item.width }" <h4>GitHub信息</h4>
> <ReGithub />
<h4>{{ item.title }}</h4> </el-card>
<component :is="item.component"></component> </template>
</div> </el-skeleton>
</template> </el-col>
</el-skeleton>
</el-space> <el-col
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
style="margin-bottom: 20px"
>
<el-skeleton animated :rows="7" :loading="false">
<template #default>
<el-card>
<h4>GitHub滚动信息</h4>
<ReInfinite />
</el-card>
</template>
</el-skeleton>
</el-col>
<el-col
:xs="24"
:sm="12"
:md="12"
:lg="8"
:xl="8"
style="margin-bottom: 20px"
>
<el-skeleton animated :rows="7" :loading="false">
<template #default>
<el-card>
<h4>GitHub饼图信息</h4>
<RePie />
</el-card>
</template>
</el-skeleton>
</el-col>
<el-col
:xs="24"
:sm="12"
:md="12"
:lg="8"
:xl="8"
style="margin-bottom: 20px"
>
<el-skeleton animated :rows="7" :loading="false">
<template #default>
<el-card>
<h4>GitHub折线图信息</h4>
<ReLine />
</el-card>
</template>
</el-skeleton>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="24"
:lg="8"
:xl="1"
style="margin-bottom: 20px"
>
<el-skeleton animated :rows="7" :loading="false">
<template #default>
<el-card>
<h4>GitHub柱状图信息</h4>
<ReBar />
</el-card>
</template>
</el-skeleton>
</el-col>
</el-row>
</div> </div>
</template> </template>
@ -126,8 +144,11 @@ const openDepot = (): void => {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-content {
margin: 0;
}
.welcome { .welcome {
width: 100%;
height: 100%; height: 100%;
.top-content { .top-content {
@ -155,22 +176,5 @@ const openDepot = (): void => {
} }
} }
} }
.space {
display: flex;
justify-content: center;
align-items: center;
margin-left: 8px;
padding: 10px;
.echart-card {
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
h4 {
margin: 0;
padding: 20px;
}
}
}
} }
</style> </style>