<template>
  <div class="cmain">
    <VueOfficeDocx :src="docx" :options="editorOptions" @rendered="rendered" />
  </div>
</template>

<script>
import VueOfficeDocx from '@vue-office/docx'; //引入VueOfficeDocx组件
import '@vue-office/docx/lib/index.css';
export default {
  components: {
    VueOfficeDocx
  },
  data() {
    return {
      docx: '',
      editorOptions: {
        toolbar: true,
        width: '100px',
        height: '600px'
      }
    };
  },
  props: {
    param: {
      type: Object,
      default: () => {
        return {};
      }
    },
    layerid: {
      type: String
    }
  },
  mounted() {
    this.docx = this.baseUrl + this.param.url;
  },
  methods: {
    rendered() {
      console.log('渲染完成');
    }
  }
};
</script>
