查找替换
Facade API | 付费版本 | 需要 Univer 服务端 | Univer on Node.js | Preset |
---|---|---|---|---|
✅ | - | - | - | UniverSheetsFindReplacePreset |
查找替换插件提供了对单元格的查找替换功能。
该功能包含以下插件包:
@univerjs/find-replace
- 基础查找替换插件@univerjs/sheets-find-replace
- sheet 查找替换插件
Presets 安装
import { createUniver, defaultTheme, LocaleType, Tools } from '@univerjs/presets';
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
import UniverPresetSheetsCoreEnUS from '@univerjs/presets/preset-sheets-core/locales/en-US';
import { UniverSheetsFindReplacePreset } from '@univerjs/presets/preset-sheets-find-replace';
import UniverPresetSheetsFindReplaceZhCN from '@univerjs/presets/preset-sheets-find-replace/locales/en-US';
const { univerAPI } = createUniver({
locale: LocaleType.EN_US,
locales: {
enUS: Tools.deepMerge(
{},
UniverPresetSheetsCoreZhCN,
UniverPresetSheetsFindReplaceZhCN
),
},
theme: defaultTheme,
presets: [
UniverSheetsCorePreset(),
UniverSheetsFindReplacePreset(),
],
});
高级安装
npm install @univerjs/find-replace @univerjs/sheets-find-replace
import { LocaleType, Tools } from '@univerjs/core';
import { UniverFindReplacePlugin } from '@univerjs/find-replace';
import { UniverSheetsFindReplacePlugin } from '@univerjs/sheets-find-replace';
import FindReplaceZhCN from '@univerjs/find-replace/locale/zh-CN';
import SheetsFindReplaceZhCN from '@univerjs/sheets-find-replace/locale/zh-CN';
import '@univerjs/find-replace/lib/index.css';
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.ZH_CN,
locales: {
[LocaleType.ZH_CN]: Tools.deepMerge(
FindReplaceZhCN,
SheetsFindReplaceZhCN
),
},
});
univer.registerPlugin(UniverFindReplacePlugin);
univer.registerPlugin(UniverSheetsFindReplacePlugin);