Skip to content

Commit 2f505aa

Browse files
author
reco_luan
committed
fix: fix error when no friend-link config
1 parent 19f2da0 commit 2f505aa

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

components/FriendLink.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ export default {
5353
},
5454
computed: {
5555
dataAddColor () {
56-
let friendLink = this.$themeConfig.friendLink
57-
friendLink = friendLink.length > 0 ? friendLink.map(item => ({
58-
...item,
59-
color: this._tagColor()
60-
})) : []
61-
return friendLink
56+
let { friendLink } = this.$themeConfig
57+
if (friendLink && friendLink.length > 0) {
58+
friendLink = friendLink.map(item => ({
59+
...item,
60+
color: this._tagColor()
61+
}))
62+
return friendLink
63+
}
64+
return []
6265
}
6366
},
6467
methods: {

0 commit comments

Comments
 (0)