指南Univer Sheets功能Uniscript

Uniscript

Facade API付费版本需要 Univer 服务端Univer on Node.jsPreset
---❌ 通过 plugin 引入

该功能包含以下插件包:

Presets 安装

npm install @univerjs/uniscript
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
import UniverPresetSheetsCoreZhCN from '@univerjs/presets/preset-sheets-core/locales/zh-CN';
import { UniverUniscriptPlugin } from '@univerjs/uniscript';
import UniscriptZhCN from '@univerjs/uniscript/locale/zh-CN';
 
import '@univerjs/uniscript/lib/index.css';
 
import '@univerjs/uniscript/facade';
 
const { univerAPI } = createUniver({
  locale: LocaleType.ZH_CN,
  locales: {
    zhCN: Tools.deepMerge(
      {},
      UniverPresetSheetsCoreZhCN,
      UniscriptZhCN 
    ),
  },
  theme: defaultTheme,
  presets: [
    UniverSheetsCorePreset(),
  ],
  plugins: [
    UniverUniscriptPlugin 
  ],
});

高级安装

npm install @univerjs/uniscript
import { LocaleType, Tools } from '@univerjs/core';
import { UniverUniscriptPlugin } from '@univerjs/uniscript';
import UniscriptZhCN from '@univerjs/uniscript/locale/zh-CN';
 
import '@univerjs/uniscript/lib/index.css';
 
const univer = new Univer({
  theme: defaultTheme,
  locale: LocaleType.ZH_CN,
  locales: {
    [LocaleType.ZH_CN]: Tools.deepMerge(
      UniscriptZhCN
    ),
  },
});
 
univer.registerPlugin(UniverUniscriptPlugin);