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