查找替换
Facade API | 可付费升级 | 需要 Univer 服务端 | Univer on Node.js | Preset |
---|---|---|---|---|
- | - | - | - | UniverSheetsFindReplacePreset |
查找替换插件提供了对单元格的查找替换功能。
该功能包含以下插件包:
@univerjs/find-replace
- 基础查找替换插件@univerjs/sheets-find-replace
- sheet 查找替换插件
Presets 安装
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets';
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core';
import UniverPresetSheetsCoreZhCN from '@univerjs/presets/preset-sheets-core/locales/zh-CN';
import { UniverSheetsFindReplacePreset } from '@univerjs/presets/preset-sheets-find-replace';
import UniverPresetSheetsFindReplaceZhCN from '@univerjs/presets/preset-sheets-find-replace/locales/zh-CN';
import '@univerjs/presets/lib/styles/preset-sheets-find-replace.css'
const { univerAPI } = createUniver({
locale: LocaleType.EN_US,
locales: {
[LocaleType.EN_US]: merge(
{},
UniverPresetSheetsCoreZhCN,
UniverPresetSheetsFindReplaceZhCN
),
},
theme: defaultTheme,
presets: [
UniverSheetsCorePreset(),
UniverSheetsFindReplacePreset(),
],
});
手动组合安装
npm install @univerjs/find-replace @univerjs/sheets-find-replace
import { LocaleType, merge, Univer } from '@univerjs/core';
import { defaultTheme } from "@univerjs/design";
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]: merge(
FindReplaceZhCN,
SheetsFindReplaceZhCN
),
},
});
univer.registerPlugin(UniverFindReplacePlugin);
univer.registerPlugin(UniverSheetsFindReplacePlugin);