能否给出个vue框架的的demo如何初始化init

阅读次数 133

vue框架直接引用import "../utils/web-office-sdk-solution-v1.1.24.umd"后,WebOfficeSDK.init报错 <img src="https://solution-community.wps.cn/uploads/post/4TKe8PSuZAG.png" alt="image.png"/> <img src="https://solution-community.wps.cn/uploads/post/4TKebkuys4b.png" alt="image.png"/>

请问如何由html兼容至vue框架

1 Answers

ES module 的使用方式,可以在文档快速开始中看到。

import WebOfficeSDK from '../utils/web-office-sdk-solution-v1.1.24.es'

const instance = WebOfficeSDK.init({
  // ...
})

但是你们的ts 文件很奇怪,明明export了 一个WebOfficeSDK,但是没有declare module,这个ts文件真的是tsc打出来的吗😂,还是js + ts混用的 😧