From 36a3d17d98ff6e69f395b4192662d67bf2c525dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 22 Aug 2024 12:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20=E5=AE=8C=E5=96=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/post/tp-text.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/post/tp-text.vue b/src/components/post/tp-text.vue index 62fc9487..1c2128f0 100644 --- a/src/components/post/tp-text.vue +++ b/src/components/post/tp-text.vue @@ -35,6 +35,7 @@ export interface TpText { bold?: boolean; color?: string; align?: string; + italic?: boolean; }; } @@ -76,9 +77,13 @@ function getTextStyle(): StyleValue { style.push("white-space: pre-wrap"); if (data.attributes) { const ruleBold: StyleValue = "fontFamily: var(--font-title)"; + const ruleItalic: StyleValue = "fontStyle: italic"; if (data.attributes.bold) { style.push(ruleBold); } + if (data.attributes.italic) { + style.push(ruleItalic); + } if (data.attributes.color) { let colorGet = data.attributes.color; if (isColorSimilar("#000000", data.attributes.color)) {