licp
2024-11-14 321370a82855d4b58d4eff2aee238672cdb8b865
src/components/tool/file-preview.vue
@@ -129,6 +129,7 @@
    renderedHandler() {
        console.log("渲染完成")
        this.isDocShow = true
        this.resetStyle()
    },
    errorHandler() {
        console.log("渲染失败")
@@ -155,7 +156,6 @@
          return obj
        })
        this.csvList = arr
        console.log(4444,this.csvList)
      }).catch( err => {
        console.log(err)
      })
@@ -197,6 +197,15 @@
      }
      return result
    },
    resetStyle(){
      const elements = document.querySelectorAll('[style*="pt"]');
      for (const element of elements) {
        const style = element.getAttribute('style');
        if (!!style) {
          element.setAttribute('style', style.replace(/pt/g, 'px'));
        }
      }
    }
  }
}
</script>