npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-live2d

v1.3.8

Published

一个适用于 Vue 2 和 Vue 3 项目的 Live2D 看板组件

Readme

vue-live2d

🚀 效果预览

在线预览

本地预览

git clone https://github.com/evgo2017/vue-live2d.git
cd ./vue-live2d
npm install
npm run serve

📦 安装与使用

# 1. 安装组件
npm install vue-live2d

# 2. 在组件中引入
import vueLive2d from 'vue-live2d'
export default {
  components: { vueLive2d }
}

本组件同时支持 Vue 2 (^2.7.x) 和 Vue 3 (Options/Composition API),并提供了测试用例。


⚙️ 配置参数 (Props)

| 配置项 | 含义 | 类型 | 默认值 | | :--- | :--- | :--- | :--- | | apiPath | 核心地址,请求此 API 加载模型数据 | String | https://cdn.jsdelivr.net/npm/live2d-static-api@latest/indexes | | model | 默认显示的 [模型号, 服装ID] | Array | ['Potion-Maker/Pio', 'school-2017-costume-yellow'] | | width/height/size | 模型的宽度/高度/宽度和高度 | Number | 0 / 0 / 255 | | direction | 模型停靠方位 (left / right) | String | right | | tipPosition | 提示框位置 (top / bottom) | String | top | | tips | 自定义交互提示语配置 | Object | 详见 /src/options/tips.js | | speechApi | 语音接口,点击对话图标时请求的 API 地址 | String | https://v1.hitokoto.cn | | speechContentFormat | 内容格式化函数,解析 API 返回的数据 | Function | 接收 API 返回的原始数据对象,并返回一个字符串 | | homePage | 点击主页链接跳转的地址 | String | 本项目主页地址 | | customId | 同一页面加载多个模型时的识别 ID | String | vue-live2d-main |

📡 核心参数 apiPath

  1. 方法一:项目本地集成(避开第三方接口失效)live2d-static-apiindexes 放入项目的 public 目录,你可以彻底告别后端维护,实现极致的加载和稳定性:

    apiPath="./live2d-static-api/indexes"

    apiPath

  2. 方法二:NPM / CDN 模式(推荐,极致稳定) 利用 NPM 公用 CDN 加速,实现零环境依赖的静态分发:

    apiPath="https://cdn.jsdelivr.net/npm/live2d-static-api@latest/indexes" // 推荐 JSdelivr
    apiPath="https://unpkg.com/live2d-static-api@latest/indexes"          // 国内 Unpkg
    apiPath="https://raw.githubusercontent.com/evgo2017/live2d-static-api/main/indexes" // GitHub

其它参数说明

  • model:切换模型或换装时,控制台会输出相关编码信息,直接复制即可。

  • 宽高控制widthheight 的优先级高于 size。建议使用 size 统一缩放,以减少模型重新加载的次数。

  • 多模型同屏:通过 customId 可以在同一页面渲染多个组件。但受限于核心库逻辑,同一时间通常只有一个模型支持动态交互。

  • 💬 语音对话 (Speech):你可以通过自定义接口和格式化函数,让看板接入任何内容源(如:诗词、名言、甚至 AI 回复):

<!-- 自定义用法 -->
<vue-live2d 
  speechApi="https://api.xxx.com/api" 
  :speechContentFormat="(content) => `自定义解析和返回内容 ${content}`" 
/>

📈 Star History

Star History Chart

参考资料与核心库

[1] fghrsh/live2d_demo [2] stevenjoezhang/live2d-widget [3] fghrsh/live2d_api

尝试过基于 Live2D 官网发布的 Live2D_SDK_WEBGL_2.1 SDK 中的 live2d.min.jsLive2DFramework.jssampleApp1,和 live2d.min.js 代码进行二次梳理。技术链路遵循:Core -> Framework -> App -> vue-live2d

联系方式

若遇到问题,请提交 issue。或访问 evgo2017.com/about