This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree 1 file changed +13
-14
lines changed
1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <a
3
- v-if =" getFirstEnabledFeed"
4
- class =" feed"
5
- :href =" getFirstEnabledFeed | getFeedFilePath"
6
- >
2
+ <a v-if =" firstEnabledFeed" class =" feed" :href =" feedFilePath" >
7
3
<RssIcon />
8
4
</a >
9
5
</template >
@@ -13,22 +9,25 @@ import { RssIcon } from 'vue-feather-icons'
13
9
14
10
export default {
15
11
components: { RssIcon },
16
- filters: {
17
- getFeedFilePath (feed ) {
18
- if (feed === ' rss' ) return ' /rss.xml'
19
- if (feed === ' atom' ) return ' /feed.atom'
20
- if (feed === ' json' ) return ' /feed.json'
21
- return ' '
22
- },
23
- },
12
+
24
13
computed: {
25
- getFirstEnabledFeed () {
14
+ firstEnabledFeed () {
26
15
for (const feed in this .$service .feed ) {
27
16
const isEnabled = this .$service .feed [feed]
28
17
if (isEnabled) return feed
29
18
}
30
19
return false
31
20
},
21
+ feedFilePath () {
22
+ if (! this .firstEnabledFeed ) return
23
+
24
+ let path = ' '
25
+ if (this .firstEnabledFeed === ' rss' ) path = ' /rss.xml'
26
+ if (this .firstEnabledFeed === ' atom' ) path = ' /feed.atom'
27
+ if (this .firstEnabledFeed === ' json' ) path = ' /feed.json'
28
+
29
+ return this .$withBase (path)
30
+ },
32
31
},
33
32
}
34
33
</script >
You can’t perform that action at this time.
0 commit comments