Browse Source

增加Text的换行支持

Stefan Zhu 2 years ago
parent
commit
bd3754c73c

+ 8 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/texts/widget-text.js

@@ -90,6 +90,14 @@ export const widgetText = {
         ],
         value: 'center'
       },
+      {
+        type: 'el-switch',
+        label: '识别换行符',
+        name: 'whiteSpace',
+        required: false,
+        placeholder: '',
+        value: true,
+      }
     ],
     // 数据
     data: [

+ 2 - 1
report-ui/src/views/bigscreenDesigner/designer/widget/texts/widgetText.vue

@@ -40,7 +40,8 @@ export default {
         height: this.transStyle.height + "px",
         left: this.transStyle.left + "px",
         top: this.transStyle.top + "px",
-        right: this.transStyle.right + "px"
+        right: this.transStyle.right + "px",
+        whiteSpace: this.transStyle.whiteSpace ? "pre-line": null
       };
     }
   },