瀏覽代碼

表格兼容样式删除线、下划线

cldu 4 天之前
父節點
當前提交
2efc80b76b
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 4 2
      src/CustomElement/EtaTable.ce.vue
  2. 4 2
      src/views/ppt/components/SheetWrap.vue

+ 4 - 2
src/CustomElement/EtaTable.ce.vue

@@ -71,13 +71,15 @@ async function getTableData(){
 getTableData()
 
 function handleCellStyle(cell){
-    return `
+    let res = `
         color: ${cell.fc};
         font-weight: ${cell.bl ? 'bold' : 'normal'};
         font-style: ${cell.it ? 'italic' : 'normal'};
         text-align: ${HtObj[cell.HorizontalType]};
         font-family: ${handleFF(cell.ff)};
-    `
+    `;
+    if(cell.cl || cell.un) res += `text-decoration:${cell.cl ? 'line-through' : ''}  ${cell.un ? 'underline' : ''};`;
+    return res;
 }
 
 function handleFF(ff){

+ 4 - 2
src/views/ppt/components/SheetWrap.vue

@@ -57,13 +57,15 @@ function setDefaultSource(sourceText){
 }
 
 function handleCellStyle(cell){
-    return `
+    let res =  `
         color: ${cell.fc};
         font-weight: ${cell.bl ? 'bold' : 'normal'};
         font-style: ${cell.it ? 'italic' : 'normal'};
         text-align: ${HtObj[cell.HorizontalType]};
         font-family: ${handleFF(cell.ff)};
-    `
+    `;
+    if(cell.cl || cell.un) res += `text-decoration:${cell.cl ? 'line-through' : ''}  ${cell.un ? 'underline' : ''};`;
+    return res;
 }
 
 function handleFF(ff){