Address code review: use named constant and safe initialization

Co-authored-by: Sunwuyuan <88357633+Sunwuyuan@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-24 10:36:30 +00:00
co-authored by Sunwuyuan
parent a332d9365f
commit bf56de8299
+3 -3
View File
@@ -66,7 +66,7 @@ export default {
loading: false, loading: false,
timer: null, timer: null,
unwatch: null, unwatch: null,
fontSize: SettingsManager.getSetting('font.size') fontSize: 28 // Will be updated in mounted()
} }
}, },
computed: { computed: {
@@ -79,9 +79,9 @@ export default {
} }
}, },
authorStyle() { authorStyle() {
// Author font size is 60% of the main font size const AUTHOR_FONT_RATIO = 0.6 // Author font size is 60% of the main font size
return { return {
'font-size': `${this.fontSize * 0.6}px`, 'font-size': `${this.fontSize * AUTHOR_FONT_RATIO}px`,
'text-align': 'left' 'text-align': 'left'
} }
} }