前端vue基于onlyoffice实现在线预览

html

 

js

	xianshi() {
  new DocsAPI.DocEditor("placeholder", {
    document: {
      key: null,
      title: "pdf",
      // "url": "http://www.sqber.com/1.xlsx",
      url:放你需要预览的文件的路径
        
      fileType: "pdf",
      permissions: {
        comment: false,
        download: false,
        edit: false,
        fillForms: false,
        modifyContentControl: false,
        modifyFilter: false,
        print: false,
        review: false
      }
    },
    editorConfig: {
      mode: "view",
      customization: {
        chat: false,
        comments: false,
        compactHeader: true,
        compactToolbar: true,
        help: true
      }
    },
    documentType: "text", // 文档类-text、表格类-spreadsheet、ppt类-presentation
    width: "100%",
   

你可能感兴趣的:(vue,onlyoffice,html,vue.js)