Skip to content

Commit

Permalink
✨ optimizate similar recommend component CLS
Browse files Browse the repository at this point in the history
  • Loading branch information
轩帅 authored and 轩帅 committed Aug 31, 2022
1 parent 5b701f8 commit fb2804c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/components/SimilarRecommend.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,29 @@

<script>
import { getHostnameByUrl, interceptString } from './../helper/tool'
import { NICE_LINKS_NAME } from './../config/constant'
import { NICE_LINKS, NICE_LINKS_NAME, DESCRIPTION } from './../config/constant'
import pageMixin from 'mixins/pageMixin.js'
import marked from 'marked'
const DEFAULT_LINKS_ARR = [];
[0, 1, 2, 3, 4].map(() => {
DEFAULT_LINKS_ARR.push({
urlPath: NICE_LINKS,
item: NICE_LINKS_NAME,
desc: DESCRIPTION,
_id: '5aa2579e56ee0d60651820c5',
review: DESCRIPTION
})
})
export default {
name: 'SimilarRecommend',
mixins: [pageMixin],
data() {
return {
linksArr: [],
linksArr: Object.freeze(DEFAULT_LINKS_ARR),
RECOMMEND_NUM: 5,
isShowPlaceholder: true,
}
Expand All @@ -57,11 +68,9 @@ export default {
mounted() {
setTimeout(() => {
this.isShowPlaceholder = false
}, 300)
}, 200)
},
components: {},
methods: {
assembleSimilarLinks(resArr) {
const tempArr = resArr.filter((item) => {
Expand Down
2 changes: 2 additions & 0 deletions src/config/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const NICE_LINKS_NAME = '倾城之链'

export const NICE_LINKS = 'https://nicelinks.site'

export const DESCRIPTION = `倾城之链,作为一个开放平台,旨在云集全球优秀网站,探索互联网中更广阔的世界;在这里,你可以轻松发现、学习、分享更多有用或有趣的事物。`

export const REDIRECT_PATH = `${NICE_LINKS}/redirect?url=`

export const REPORT_PATH = `${REDIRECT_PATH}https://support.qq.com/products/340357&isauto=true`
Expand Down
6 changes: 4 additions & 2 deletions src/locales/zh.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { DESCRIPTION } from './../config/constant'

export default {
signIn: '登录',
signUp: '注册',
Expand Down Expand Up @@ -95,6 +97,6 @@ export default {
enterLegalEmailTip: '请输入有效邮箱',

keywords:
'倾城之链, nice links, 资源之家, 新媒体导航, 网站, 利器, 新世界, 技术, 产品, 有趣, 人文, 历史, 工具, 社区, 旅行, 美图, 历史, 人文, 娱乐, 抠图, 高效, 搜商, 搜索, 引擎, 思谷搜, 快应用, 翁天信, 天空之城',
description: `倾城之链,作为一个开放平台,旨在云集全球优秀网站,探索互联网中更广阔的世界;在这里,你可以轻松发现、学习、分享更多有用或有趣的事物。`,
'倾城之链, nice links, 资源之家, 新媒体导航, 网站, 利器, 新世界, 技术, 产品, 有趣, 人文, 历史, 工具, 社区, 旅行, 美图, 历史, 人文, 娱乐, 抠图, 高效, 搜商, 搜索, 引擎, 思谷搜, 快应用, 翁天信, 天空之城, 夸人生成器',
description: DESCRIPTION
}

0 comments on commit fb2804c

Please sign in to comment.