禅编辑器
Facade API | 付费版本 | 需要 Univer 服务端 | Univer on Node.js | Preset |
---|---|---|---|---|
✅ | - | - | - | ❌ 通过 plugin 引入 |
禅编辑器插件提供了一种沉浸式的单元格编辑体验。通过禅编辑器,你可以轻松地以文档编辑器的形式在单元格中编辑文本等内容。
该功能包含以下插件包:
Presets 安装
npm install @univerjs/sheets-zen-editor
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 { UniverSheetsZenEditorPlugin } from '@univerjs/sheets-zen-editor';
import SheetsZenEditorZhCN from '@univerjs/sheets-zen-editor/locale/zh-CN';
import '@univerjs/sheets-zen-editor/lib/index.css';
const { univerAPI } = createUniver({
locale: LocaleType.ZH_CN,
locales: {
zhCN: Tools.deepMerge(
{},
UniverPresetSheetsCoreZhCN,
SheetsZenEditorZhCN
),
},
theme: defaultTheme,
presets: [
UniverSheetsCorePreset(),
],
plugins: [
UniverSheetsZenEditorPlugin
],
});
高级安装
npm install @univerjs/sheets-zen-editor
import { UniverSheetsZenEditorPlugin } from '@univerjs/sheets-zen-editor';
import { LocaleType, Tools } from '@univerjs/core';
import SheetsZenEditorZhCN from '@univerjs/sheets-zen-editor/locale/zh-CN';
import '@univerjs/sheets-zen-editor/lib/index.css';
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.ZH_CN]: Tools.deepMerge(
SheetsZenEditorZhCN
),
},
});
univer.registerPlugin(UniverSheetsZenEditorPlugin);