API 参考

@univerjs-pro/docs-sdt

本 API 页面目前提供英文正文。代码签名与标识符不随界面语言变化。

Structured document tag (SDT) commands for Docs content controls. Register the Docs core and license plugins first, then add this plugin and the optional @univerjs-pro/docs-sdt-ui editor controls.

TypeScript
import { UniverDocsSdtPlugin } from '@univerjs-pro/docs-sdt'univer.registerPlugin(UniverDocsSdtPlugin)

Commands and locks

The root exports UpdateSdtValueCommand, UpdateSdtPropertiesCommand, RemoveSdtCommand, DuplicateRepeatingSdtItemCommand, DeleteRepeatingSdtItemCommand, and their parameter types. Run them through the command service or univerAPI.executeCommand() so edits participate in undo/redo.

Content controls live in IDocumentBody.customRanges, with their properties in ISdtCustomRange.properties. Content locks prevent value edits; control locks prevent removing the wrapper. Repeating sections can also disallow item insertion and deletion. The root exports isSdtContentLocked, isSdtWrapperLocked, and findSdtAtOffset for integrations.

This package has no stylesheet, locales, or Facade entry. DOCX conversion belongs to Exchange; editor support does not guarantee lossless support for every Word property or custom XML binding. See the content-controls guide.

你觉得这篇文档如何?

© 2026 DreamNum Co., Ltd.