|
@@ -14,7 +14,7 @@
|
|
|
<ImageBg :src="styleMap?.mainStyle?.imageSrc" :imageStyle="styleMap?.mainStyle?.imageStyle" />
|
|
<ImageBg :src="styleMap?.mainStyle?.imageSrc" :imageStyle="styleMap?.mainStyle?.imageStyle" />
|
|
|
<span
|
|
<span
|
|
|
ref="txtRef"
|
|
ref="txtRef"
|
|
|
- class="z-2 lv_label_txt break-all whitespace-pre"
|
|
|
|
|
|
|
+ class="z-2 lv_label_txt break-all whitespace-pre-wrap"
|
|
|
:style="textStyle"
|
|
:style="textStyle"
|
|
|
v-html="innerText"
|
|
v-html="innerText"
|
|
|
></span>
|
|
></span>
|
|
@@ -108,8 +108,10 @@ const highlight = (html: string, start: number, end: number): string => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 处理symbol图标
|
|
// 处理symbol图标
|
|
|
|
|
+const normalizeLineBreaks = (text: string) => text.replace(/\\r\\n|\\n|\\r/g, '\n')
|
|
|
|
|
+
|
|
|
const innerText = computed(() => {
|
|
const innerText = computed(() => {
|
|
|
- const text = resolveText(props.text, true).text
|
|
|
|
|
|
|
+ const text = normalizeLineBreaks(resolveText(props.text, true).text)
|
|
|
const pattern = /\{LV[^}]*\}/g
|
|
const pattern = /\{LV[^}]*\}/g
|
|
|
const matches = text.match(pattern)
|
|
const matches = text.match(pattern)
|
|
|
const map: Record<string, string> = {}
|
|
const map: Record<string, string> = {}
|
|
@@ -143,7 +145,7 @@ const styleMap = useWidgetStyle({
|
|
|
props
|
|
props
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-useLongMode(txtRef, boxRef, props)
|
|
|
|
|
|
|
+useLongMode(txtRef, boxRef, props, { preserveLineBreaks: true })
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|