File tree Expand file tree Collapse file tree 3 files changed +63
-15
lines changed
Expand file tree Collapse file tree 3 files changed +63
-15
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" friend-link-wrapper" >
3+ <a
4+ v-for =" (item, index) in $themeConfig.friendLink"
5+ :key =" index"
6+ :href =" item.link"
7+ target =" _blank" >
8+ <span
9+ class =" list-style"
10+ :style =" { 'backgroundColor': _tagColor() }" >
11+ </span >
12+ {{item.title}}
13+ </a >
14+ </div >
15+ </template >
16+
17+ <script >
18+ import mixin from ' @theme/mixins/index.js'
19+
20+ export default {
21+ mixins: [mixin]
22+ }
23+ </script >
24+
25+ <style lang="stylus" scoped>
26+ @require '../styles/recoConfig.styl'
27+
28+ .friend-link-wrapper
29+ margin 30px 0
30+ > a
31+ position relative
32+ vertical-align : middle ;
33+ margin : 4px 4px 10px ;
34+ padding : 4px 8px 4px 20px ;
35+ display : inline-block ;
36+ cursor : pointer ;
37+ border-radius : $borderRadius
38+ background : #f f f ;
39+ font-size : 13px ;
40+ box-shadow $boxShadow
41+ transition : all .5s
42+ .list-style
43+ position absolute
44+ left .4rem
45+ top 0
46+ bottom 0
47+ margin auto
48+ display block
49+ width .4rem
50+ height .4rem
51+ border-radius .1rem
52+ background $accentColor
53+ content ''
54+ & :hover
55+ transform scale (1.04 )
56+ </style >
Original file line number Diff line number Diff line change 4646 </ul >
4747 <hr >
4848 <h4 v-if =" $tags.list.length !== 0" ><i class =" iconfont reco-tag" ></i > 标签</h4 >
49- <TagList @getCurrentTag =" getPagesByTags" ></TagList >
49+ <TagList @getCurrentTag =" getPagesByTags" />
50+ <h4 v-if =" $themeConfig.friendLink && $themeConfig.friendLink.length !== 0" ><i class =" iconfont reco-tag" ></i > 友链</h4 >
51+ <FriendLink />
5052 </div >
5153 </div >
5254
5658
5759<script >
5860import TagList from ' @theme/components/TagList.vue'
61+ import FriendLink from ' @theme/components/FriendLink.vue'
5962import NoteAbstract from ' @theme/components/NoteAbstract.vue'
6063import mixin from ' @theme/mixins/index.js'
6164
6265export default {
6366 mixins: [mixin],
64- components: { NoteAbstract, TagList },
67+ components: { NoteAbstract, TagList, FriendLink },
6568 data () {
6669 return {
6770 recoShow: false ,
Original file line number Diff line number Diff line change 11<template >
22 <div class =" tags" >
33 <span
4- v-for =" (item, index) in tags"
4+ v-for =" (item, index) in $ tags.list "
55 :key =" index"
66 :class =" {'active': item.name == currentTag}"
7- :style =" { 'backgroundColor': item.color }"
7+ :style =" { 'backgroundColor': _tagColor() }"
88 @click =" tagClick(item.name)" >{{item.name}}</span >
99 </div >
1010</template >
@@ -25,17 +25,6 @@ export default {
2525 tags: []
2626 }
2727 },
28- created () {
29- if (this .$tags .list .length > 0 ) {
30- const tags = this .$tags .list
31- tags .map (item => {
32- const color = this ._tagColor ()
33- item .color = color
34- return tags
35- })
36- this .tags = [{ name: ' 全部' , color: this ._tagColor () }, ... tags]
37- }
38- },
3928 methods: {
4029 tagClick (tag ) {
4130 this .$emit (' getCurrentTag' , tag)
You can’t perform that action at this time.
0 commit comments