Vue에 통합하기

먼저 설치 및 기본 사용법을 읽으세요. 아래 예제는 Vue를 사용해 높이가 명시된 컨테이너에 Univer Boards를 마운트합니다.

통합 단계

  1. onMounted에서 Univer를 초기화합니다.
  2. onBeforeUnmount에서 Univer를 해제합니다.

예제 코드

Vue
<script setup lang="ts">import { onBeforeUnmount, onMounted, ref } from 'vue'import { UniverBoardsPlugin } from '@univerjs-pro/boards'import { UniverBoardsUIPlugin } from '@univerjs-pro/boards-ui'import BoardsUIkoKR from '@univerjs-pro/boards-ui/locale/ko-KR'import { UniverInkUIPlugin } from '@univerjs-pro/ink-ui'import InkUIkoKR from '@univerjs-pro/ink-ui/locale/ko-KR'import { UniverLicensePlugin } from '@univerjs-pro/license'import { LocaleType, mergeLocales, Univer, UniverInstanceType } from '@univerjs/core'import DesignkoKR from '@univerjs/design/locale/ko-KR'import { UniverDocsPlugin } from '@univerjs/docs'import { UniverDocsUIPlugin } from '@univerjs/docs-ui'import DocsUIkoKR from '@univerjs/docs-ui/locale/ko-KR'import { UniverDrawingPlugin } from '@univerjs/drawing'import { UniverDrawingUIPlugin } from '@univerjs/drawing-ui'import DrawingUIkoKR from '@univerjs/drawing-ui/locale/ko-KR'import { UniverRenderEnginePlugin } from '@univerjs/engine-render'import { UniverUIPlugin } from '@univerjs/ui'import UIkoKR from '@univerjs/ui/locale/ko-KR'import '@univerjs/design/lib/index.css'import '@univerjs/ui/lib/index.css'import '@univerjs/docs-ui/lib/index.css'import '@univerjs/drawing-ui/lib/index.css'import '@univerjs-pro/ink-ui/lib/index.css'import '@univerjs-pro/boards-ui/lib/index.css'const containerRef = ref<HTMLDivElement | null>(null)let univerInstance: Univer | undefinedonMounted(() => {  const container = containerRef.value  if (!container) return  const univer = new Univer({    locale: LocaleType.KO_KR,    locales: {      [LocaleType.KO_KR]: mergeLocales(        DesignkoKR,        UIkoKR,        DocsUIkoKR,        DrawingUIkoKR,        InkUIkoKR,        BoardsUIkoKR,      ),    },  })  univer.registerPlugin(UniverLicensePlugin, {    license: 'your license.txt',  })  univer.registerPlugin(UniverRenderEnginePlugin)  univer.registerPlugin(UniverUIPlugin, { container })  univer.registerPlugin(UniverDocsPlugin)  univer.registerPlugin(UniverDocsUIPlugin)  univer.registerPlugin(UniverDrawingPlugin)  univer.registerPlugin(UniverDrawingUIPlugin)  univer.registerPlugin(UniverInkUIPlugin)  univer.registerPlugin(UniverBoardsPlugin)  univer.registerPlugin(UniverBoardsUIPlugin)  univer.createUnit(UniverInstanceType.UNIVER_BOARD, {})  univerInstance = univer})onBeforeUnmount(() => univerInstance?.dispose())</script><template>  <div ref="containerRef" style="height: 600px" /></template>

이 가이드는 어떠셨나요?

© 2026 DreamNum Co., Ltd.