项目介绍

xsoulspace/officejs_dart 是一个托管在 GitHub 上的开源项目,主要使用 Dart 编写,目前获得 5 个 Star、1 次 Fork。

仓库全名
xsoulspace/officejs_dart
Star 数
5
Fork 数
1
未关闭 Issue
4

README 摘要

Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart Please note: the package is a Work In Progress and in highly risk of change. Do not use it in production. Features Getting started with Excel To start, add in the index.html "Initialize office" then section. That's all you need to do) Getting started with Outlook To start, add in the index.html "Initialize office" then section…

完整内容见 GitHub 原始 README 或本页 。

常见问题

officejs_dart 用什么语言开发?

主要使用 Dart 编写,目前有 5 个 Star。

如何获取 officejs_dart 的源码?

可以直接克隆仓库:git clone https://github.com/xsoulspace/officejs_dart.git;安装与运行步骤见仓库 README。

officejs_dart 最近还在维护吗?

仓库最近一次更新为 2025年5月31日,当前有 4 个未关闭 Issue;Star 数为 5,可作为社区活跃度的参考。

关于

Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
12
价值分
3
活跃状态
活跃

README

Unofficial Office.js (https://github.com/OfficeDev/office-js) wrapper for Flutter/Dart

Please note: the package is a Work In Progress and in highly risk of change. Do not use it in production.

Features

Getting started with Excel

To start, add in the index.html “Initialize office” then section. That’s all you need to do)

window.addEventListener("load", function (ev) {
  // Download main.dart.js
  _flutter.loader
    .loadEntrypoint({
      serviceWorker: {
        serviceWorkerVersion: serviceWorkerVersion,
      },
    })
    .then(function (engineInitializer) {
      return engineInitializer.initializeEngine();
    })
    .then(function (appRunner) {
      return appRunner.runApp();
    })
    /** Initialize office **/
    .then(function () {
      console.log("intializing office");
      const officeEl = document.getElementById("office");
      if (officeEl != null) return;

      const scriptTag = document.createElement("script");
      scriptTag.src =
        "https://appsforoffice.microsoft.com/lib/1/hosted/office.js";
      scriptTag.id = "office";
      scriptTag.addEventListener("load", () => {
        console.log("office loaded");
        class OfficeHelpers {
          officeOnReady = Office.onReady;
          // may cause an error Excel is not defined
          runExcel = Excel.run;
        }
        window["getOfficeHelpers"] = () => new OfficeHelpers();
        console.log("helpers injected");
      });
      document.getElementsByTagName("head")[0].appendChild(scriptTag);
    });
});

Getting started with Outlook

To start, add in the index.html “Initialize office” then section. That’s all you need to do)

window.addEventListener("load", function (ev) {
  // Download main.dart.js
  _flutter.loader
    .loadEntrypoint({
      serviceWorker: {
        serviceWorkerVersion: serviceWorkerVersion,
      },
    })
    .then(function (engineInitializer) {
      return engineInitializer.initializeEngine();
    })
    .then(function (appRunner) {
      return appRunner.runApp();
    })
    /** Initialize office **/
    .then(function () {
      console.log("intializing office");
      const officeEl = document.getElementById("office");
      if (officeEl != null) return;

      const scriptTag = document.createElement("script");
      scriptTag.src =
        "https://appsforoffice.microsoft.com/lib/1/hosted/office.js";
      scriptTag.id = "office";
      scriptTag.addEventListener("load", () => {
        console.log("office loaded");
        class OfficeHelpers {
          officeOnReady = Office.onReady;
          context = Office.context;
        }
        window["getOfficeHelpers"] = () => new OfficeHelpers();
        console.log("helpers injected");
      });
      document.getElementsByTagName("head")[0].appendChild(scriptTag);
    });
});

Donations / Sponsor

Please sponsor or donate to the creator on Boosty or CloudTips.

Thank you for your support and have a great day! 🌄

Getting Help

If you need help getting started or have questions, check out our Discord Community.

Usage

Additional information

评论

暂无评论