Browse Source

表格文字颜色

natasha 2 months ago
parent
commit
fb424941da

+ 3 - 2
src/views/book/courseware/preview/components/table/TablePreview.vue

@@ -130,7 +130,7 @@
                     </p>
                   </template>
                   <template v-else>
-                    <p v-for="(item, index) in col.model_essay" :key="index">
+                    <p :style="[tdStyle]" v-for="(item, index) in col.model_essay" :key="index">
                       <span v-if="item.type === 'text'" :key="index" v-html="sanitizeHTML(item.value)"></span>
                       <template v-if="item.type === 'input'">
                         <template v-if="data.property.fill_type === fillTypeList[0].value">
@@ -248,11 +248,12 @@ export default {
         obj = {
           fontFamily: styles.fontFamily,
           fontSize: styles.fontSize,
-          fontColor: styles.fontColor,
+          color: styles.fontColor,
           textDecoration: styles.isUnderline ? 'underline' : styles.isStrikethrough ? 'line-through' : '',
           fontWeight: styles.isBold ? 'bold' : '',
           fontStyle: styles.isItalic ? 'italic' : '',
           justifyContent: styles.textAlign,
+          textAlign: styles.textAlign,
         };
       }
       return obj;