开箱即用的Live2d

  • 安装
    npm i @tomiaa/live2d

  • 代码

<template>
  <div ref="live2dContentRef" id="live2d"></div>
</template>
<script>
import {Live2d} from "@tomiaa/live2d"
export default {
  name: 'App',
  mounted() {
    new Live2d({
      el: document.getElementById("live2d"),
      showLoading: false,
      maxWidth: 300,
      jsBaseURL: "https://live2d.kuangyx.cn/public",
    });
  }
}
</script>
  • 实现效果
posted @ 2024-05-11 09:29  _seven7  阅读(27)  评论(0)    收藏  举报