初始化配置生成器

1.0.0-rc.0
可选功能
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
需要 License
import { Univer, UniverInstanceType, LocaleType, mergeLocales } from '@univerjs/core'
import { FUniver } from '@univerjs/core/facade'
import DesignLocale from '@univerjs/design/locale/zh-CN'
import { UniverRenderEnginePlugin } from '@univerjs/engine-render'
import { UniverUIPlugin } from '@univerjs/ui'
import UiLocale from '@univerjs/ui/locale/zh-CN'
import '@univerjs/ui/facade'
import { UniverDocsPlugin } from '@univerjs/docs'
import '@univerjs/docs/facade'
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula'
import EngineFormulaLocale from '@univerjs/engine-formula/locale/zh-CN'
import '@univerjs/engine-formula/facade'
import { UniverSheetsPlugin } from '@univerjs/sheets'
import SheetsLocale from '@univerjs/sheets/locale/zh-CN'
import '@univerjs/sheets/facade'
import { UniverDocsUIPlugin } from '@univerjs/docs-ui'
import DocsUiLocale from '@univerjs/docs-ui/locale/zh-CN'
import '@univerjs/docs-ui/facade'
import { UniverSheetsUIPlugin } from '@univerjs/sheets-ui'
import SheetsUiLocale from '@univerjs/sheets-ui/locale/zh-CN'
import '@univerjs/sheets-ui/facade'
import { UniverSheetsNumfmtPlugin } from '@univerjs/sheets-numfmt'
import '@univerjs/sheets-numfmt/facade'
import { UniverSheetsNumfmtUIPlugin } from '@univerjs/sheets-numfmt-ui'
import SheetsNumfmtUiLocale from '@univerjs/sheets-numfmt-ui/locale/zh-CN'
import { UniverSheetsFormulaPlugin } from '@univerjs/sheets-formula'
import SheetsFormulaLocale from '@univerjs/sheets-formula/locale/zh-CN'
import '@univerjs/sheets-formula/facade'
import { UniverSheetsFormulaUIPlugin } from '@univerjs/sheets-formula-ui'
import SheetsFormulaUiLocale from '@univerjs/sheets-formula-ui/locale/zh-CN'
import '@univerjs/sheets-formula-ui/facade'

import '@univerjs/design/lib/index.css'
import '@univerjs/ui/lib/index.css'
import '@univerjs/docs-ui/lib/index.css'
import '@univerjs/sheets-ui/lib/index.css'
import '@univerjs/sheets-numfmt-ui/lib/index.css'
import '@univerjs/sheets-formula-ui/lib/index.css'

export function mount(container, options = {}) {
  const univer = new Univer({
    locale: LocaleType.ZH_CN,
    locales: {
      [LocaleType.ZH_CN]: mergeLocales(
        DesignLocale,
        UiLocale,
        EngineFormulaLocale,
        SheetsLocale,
        DocsUiLocale,
        SheetsUiLocale,
        SheetsNumfmtUiLocale,
        SheetsFormulaLocale,
        SheetsFormulaUiLocale,
      ),
    },
  })
  univer.registerPlugin(UniverRenderEnginePlugin)
  univer.registerPlugin(UniverUIPlugin, { container })
  univer.registerPlugin(UniverDocsPlugin)
  univer.registerPlugin(UniverFormulaEnginePlugin)
  univer.registerPlugin(UniverSheetsPlugin)
  univer.registerPlugin(UniverDocsUIPlugin)
  univer.registerPlugin(UniverSheetsUIPlugin)
  univer.registerPlugin(UniverSheetsNumfmtPlugin)
  univer.registerPlugin(UniverSheetsNumfmtUIPlugin)
  univer.registerPlugin(UniverSheetsFormulaPlugin)
  univer.registerPlugin(UniverSheetsFormulaUIPlugin)
  const univerAPI = FUniver.newAPI(univer)
  univer.createUnit(UniverInstanceType.UNIVER_SHEET, options.snapshot ?? {})
  return { univer, univerAPI, dispose: () => univer.dispose() }
}
node create-univer-project.mjs
cd univer-starter
npm install
npm run dev