refacto: move size to computed values
This commit is contained in:
parent
1c566b19cb
commit
6b6d21fa2f
@ -22,7 +22,7 @@
|
||||
<template #icon>
|
||||
<Download :size="20" />
|
||||
</template>
|
||||
{{ t('repod', 'Download') }} {{ size ? `(${humanFileSize(size)})` : '' }}
|
||||
{{ t('repod', 'Download') }} {{ size ? `(${episodeFileSize})` : '' }}
|
||||
</NcButton>
|
||||
</div>
|
||||
</div>
|
||||
@ -73,6 +73,9 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
episodeFileSize() {
|
||||
return humanFileSize(this.size)
|
||||
},
|
||||
strippedDescription() {
|
||||
const pre = document.createElement('pre')
|
||||
pre.innerHTML = this.description
|
||||
@ -80,9 +83,6 @@ export default {
|
||||
return strippedDescription.replace(/\n/g, '<br>')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
humanFileSize,
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user