mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
⚡️ 完善换行处理
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<component
|
||||
v-for="(tp, index) in props.data"
|
||||
:key="index"
|
||||
:is="getTpName(tp, index)"
|
||||
:is="getTpName(tp)"
|
||||
:data="tp"
|
||||
:next="getTpNext(index)"
|
||||
/>
|
||||
@@ -25,7 +25,7 @@ interface TpParserProps {
|
||||
|
||||
const props = defineProps<TpParserProps>();
|
||||
|
||||
function getTpName(tp: TGApp.Plugins.Mys.SctPost.Base, index: number) {
|
||||
function getTpName(tp: TGApp.Plugins.Mys.SctPost.Base) {
|
||||
if (typeof tp.insert === "string") {
|
||||
return TpText;
|
||||
} else if ("image" in tp.insert) {
|
||||
|
||||
@@ -102,8 +102,10 @@ function getTextStyle(): StyleValue {
|
||||
const style = <Array<StyleValue>>[];
|
||||
let data: TpText;
|
||||
if (props.data.insert === "\n") {
|
||||
style.push("display: inline");
|
||||
return style;
|
||||
if (props.data.attributes?.align || props.data.attributes?.header) {
|
||||
return "display: none";
|
||||
}
|
||||
return "display: inline";
|
||||
}
|
||||
if (props.next?.insert === "\n") {
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user