고급 목록
향상된 목록은 Univer Docs를 배열 수준, 사용자 정의 글리프 및 목록 구조 편집으로 확장합니다.
소개
Univer Docs에서 향상된 목록은 다음과 같은 기능을 제공합니다.
- 다중 배열 수준.
- 총알 기호와 숫자 스타일의 선택.
- 목록 항목에 프로모션, 데모 및 주문 작업.
플러그인 모드
설치
Shell
pnpm add @univerjs-pro/docs-list @univerjs-pro/docs-list-uiShell
npm install @univerjs-pro/docs-list @univerjs-pro/docs-list-uiShell
yarn add @univerjs-pro/docs-list @univerjs-pro/docs-list-uiShell
bun add @univerjs-pro/docs-list @univerjs-pro/docs-list-ui사용법
TypeScript
import { UniverDocsListPlugin } from '@univerjs-pro/docs-list'import { UniverDocsListUIPlugin } from '@univerjs-pro/docs-list-ui'import DocsListUIEnUS from '@univerjs-pro/docs-list-ui/locale/en-US'import { LocaleType, mergeLocales, Univer } from '@univerjs/core'import '@univerjs-pro/docs-list-ui/lib/index.css'const univer = new Univer({ locale: LocaleType.EN_US, locales: { [LocaleType.EN_US]: mergeLocales( DocsListUIEnUS, ), },})univer.registerPlugin(UniverDocsListPlugin)univer.registerPlugin(UniverDocsListUIPlugin)상업 라이센스를 사용한다면 Client의 라이센스 사용에 설명된 것과 같이 구성하십시오.
모바일 지원
모바일 편집기를 먼저 설정하십시오. 이 페이지에서 설명 된 플러그인 모드 설정에서 동일한 패키지에서 모바일 수출으로 표시된 데스크탑 등록을 대체하고 문서 열기 교체를 완료하십시오. 모델 플러그인, 스타일, 로컬 및 Facade 가져 오기를 유지하고 두 변형을 등록하지 마십시오.
| 패키지 | 데스크톱 등록 | 모바일 등록 |
|---|---|---|
@univerjs-pro/docs-list-ui | UniverDocsListUIPlugin | UniverDocsListMobileUIPlugin |
Facade API
다음 API를 호출하기 전에 정면을 가져 오기 :
TypeScript
import '@univerjs-pro/docs-list/facade'목록 삽입하기
TypeScript
import { PresetListType } from '@univerjs/core'const doc = univerAPI.getActiveDocument()doc?.insertList({ startOffset: 0, endOffset: 10, listType: PresetListType.BULLET_LIST,})모든 목록 가져오기
TypeScript
const doc = univerAPI.getActiveDocument()const lists = doc?.getLists() ?? []목록 글머리 기호 유형 설정하기
TypeScript
const doc = univerAPI.getActiveDocument()doc?.setListGlyphType(0, ListGlyphType.DECIMAL)목록 수준 설정하기
TypeScript
const doc = univerAPI.getActiveDocument()doc?.setListLevel(0, 1)이 가이드는 어떠셨나요?