OriaTheme
GitHub

API 参考 · Vue 编辑桥接

@oriatheme/vue-editor

为本地源码 ThemeEditor 提供 Vue provide、Composable 与自动预览协调;不导出可视 UI。

包与运行环境

Vue 3.5 的客户端桥接;使用本地 CLI 安装的 ThemeEditor 作为可视根。

bash
pnpm add @oriatheme/editor-core @oriatheme/vue-editor

选择使用方项目已有的一种包管理器和 lockfile;示例只使用 package root export,不要从 src、dist 或 registry template 深层导入。

Exports

出口签名描述
provideThemeEditor(options | session) => ThemeEditorSession提供调用者会话或创建拥有的会话。
useThemeEditor() => { session, snapshot }公开只读浅编辑器快照引用。
useThemeEditorAutoPreview(runtime, mode?) => Readonly<ShallowRef<ThemeEditorAutoPreviewState>>合并有效修订并保留最后的有效预览。
re-exported editor-core typesThemeEditorOptions, ThemeEditorSession, …便利类型/域再导出;行为仍保留在编辑器核心中。
ts
import { provideThemeEditor, useThemeEditorAutoPreview } from "@oriatheme/vue-editor";

const session = provideThemeEditor(options);
const preview = useThemeEditorAutoPreview(runtime);

可视 UI 位于你的项目

此包不导出完整编辑器或默认 CSS。使用 CLI 安装多文件 Vue 源码组件,并保留 editor-core/runtime 的草稿与原子预览边界。