/*
 * @Author: LiZhiWei
 * @Date: 2025-12-26 14:35:12
 * @LastEditors: LiZhiWei
 * @LastEditTime: 2025-12-30 11:55:29
 * @Description: 
 */
import { createApp } from "vue"
import PPT from "./PPT.vue"
import { parse } from "huijia-pptxtojson"

/**
 * 渲染ppt
 */
export default async function render(buffer, target) {
  const pptxJson = await parse(buffer)
  const app = createApp(PPT, { pptxJson })
  app.mount(target)
  return {
    $el: target,
    $destroy() {
      app.unmount()
    },
  }
}
