/*
 * @Author: LiZhiWei
 * @Date: 2025-12-26 14:35:12
 * @LastEditors: LiZhiWei
 * @LastEditTime: 2025-12-26 16:22:48
 * @Description: 
 */
import { createApp } from "vue"
import PPT from "./PPT.vue"
import { parse } from "./pptxtojson.js"

/**
 * 渲染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()
    },
  }
}
