<template>
  <div>
    阅读wps
    <div id="viewFile"></div>
  </div>
</template>
<script>
import WebOfficeSDK from "/public/weboffice/web-office-sdk-v1.1.8.es";
export default {
  mounted() {
    // this.getBookList();
    console.log("WebOfficeSDK", WebOfficeSDK);
    this.openWps(this.$route.query.wpsUrl, this.$route.query.token);
  },
  methods: {
    async openWps(url, token) {
      this.wps = WebOfficeSDK.config({
        wpsUrl: url, // 如果需要通过js-sdk传递token方式鉴权，则需要包含_w_tokentype=1参数
        mount: document.querySelector("#viewFile"),
      });
      this.wps.setToken({ token });
      this.wps.ready();
    },
  },
};
</script>
<style lang=""></style>
