Skip to content

Commit

Permalink
解决页面崩溃bug
Browse files Browse the repository at this point in the history
  • Loading branch information
onresize committed Jun 17, 2024
1 parent f57de83 commit 869303b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 59 deletions.
116 changes: 59 additions & 57 deletions docs/.vuepress/components/TimeLine/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,69 @@ import { ref } from 'vue'
import Timeline from './TimeLine.vue'
const isProd = process.env.NODE_ENV === 'production'
const timelineData = ref([
{
desc: '原型链',
date: '2023/03/10',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms1.png',
color: 'green',
},
{
desc: 'React 生命周期 v16.3 以前',
date: '2023/07/19',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms2.png',
color: 'red',
},
{
desc: 'React 生命周期 only v16.3',
date: '2023/11/07',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms3.png',
color: 'blue',
},
{
desc: 'setTimeout 和 setInterval 的区别',
date: '2024/03/24',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms4.png',
color: 'pink',
},
{
desc: 'Service Worker的离线缓存',
date: '2024/04/13',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms5.png',
},
{
desc: '性能优化',
date: '2024/05/06',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms6.png',
color: 'gray',
},
{
desc: '网络传输流程',
date: '2024/06/17',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms7.png',
},
])
const timelineData = ref(
[
{
desc: '原型链',
date: '2023/03/10',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms1.png',
color: 'green',
},
{
desc: 'React 生命周期 v16.3 以前',
date: '2023/07/19',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms2.png',
color: 'red',
},
{
desc: 'React 生命周期 only v16.3',
date: '2023/11/07',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms3.png',
color: 'blue',
},
{
desc: 'setTimeout 和 setInterval 的区别',
date: '2024/03/24',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms4.png',
color: 'pink',
},
{
desc: 'Service Worker的离线缓存',
date: '2024/04/13',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms5.png',
},
{
desc: '性能优化',
date: '2024/05/06',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms6.png',
color: 'gray',
},
{
desc: '网络传输流程',
date: '2024/06/17',
imgUrl: isProd
? 'https://onresize.github.io/web-blogs'
: 'https://localhost:9008' + '/AA_mdPics/ms7.png',
},
].reverse()
)
</script>
<template>
<div class="u-card">
<Timeline
:timeline-data="timelineData.reverse()"
:timeline-data="timelineData"
mode="center"
width="66vw"
line-style="dashed"
Expand Down
4 changes: 2 additions & 2 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export default defineUserConfig({
isSearchable: (page) => page.path !== '/', // 排除首页
}),
viteCompression({
verbose: true,
disable: false, // 不禁用压缩
verbose: true, // 是否在控制台输出压缩结果
disable: false, // 是否禁用
deleteOriginFile: false, // 压缩后是否删除原文件
threshold: 10240, // 文件小于 10kb 不进行压缩
algorithm: 'gzip', // 压缩算法
Expand Down

0 comments on commit 869303b

Please sign in to comment.