For AI agents: the complete documentation index is available at /vue-vrm/zh/llms.txt, the full documentation bundle is available at /vue-vrm/zh/llms-full.txt, and this page is available as Markdown at /vue-vrm/zh/api/index.md.
  • 简体中文
  • API 概览

    VrmCanvas 组件有三类 API,此外包中还导出了辅助函数:

    页面内容
    Props模型、动画、画布、相机和灯光的设置。
    事件加载、动画、相机和灯光变化以及错误的通知。
    实例 API可通过模板引用调用的方法。
    工具函数无需组件即可校验和加载 VRM/VRMA 缓冲区的函数。
    <script setup lang="ts">
      import { ref } from 'vue';
      import { VrmCanvas, type VrmCanvasExposed } from 'vue-vrm';
    
      const modelData = ref<ArrayBuffer>();
      const canvas = ref<VrmCanvasExposed>();
    </script>
    
    <template>
      <VrmCanvas
        ref="canvas"
        :model-data="modelData"
        show-grid
        @model:loaded="() => canvas?.resetCamera()"
      />
    </template>