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-music-component

v1.1.7

Published

A music player component that contains the basic function of the player. It can set the player width, height and autoplay or not.

Readme

music

一个音乐播放器组件,包含播放器的基本功能,可以设置播放器宽高,可以设置是否自动播放

image

Build Setup

首先确保项目安装了axios

# 安装音乐播放器组件
npm install vue-music-component -s

# 引入组件
import Music from 'vue-music-component'

# 设置音乐播放器的宽高
可以在组件外面定义一个有具体宽高的div,也可以直接给组件添加class来指定宽高

# 参数
musicList:包含音乐资源的数组
    其中:
    album_title: 歌曲名称,
    artist_name: 演唱者,
    id: 唯一的id,
    src: 歌曲资源地址,
    lrcSrc: 歌词资源地址,
    pic_small: 歌曲图片资源地址
iNow:进入后显示的歌曲索引,表示数组中的第iNow首歌曲被显示在界面上,最开始一定要设置成null,随后在获取到音乐资源以后在修改iNow的值
isPlay:是否自动播放

Example:

<template>
    <music id="music" :musicList="musicList" :iNow="iNow" :isPlay="isPlay"></music>
</template>

<script>
export default {
  data() {
    return {
      // 可以用axios请求数据
      musicList: [{
            album_title: "带你去旅行",
            artist_name: "宗顺康Ken",
            id: 0,
            src: "static/music/travel.mp3",
            lrcSrc: "static/music/travel.lrc",
            pic_small: "http://qukufile2.qianqian.com/data2/pic/4a2cffbaf32b0a7cb77986bc483e8642/569217166/569217166.JPG@s_1,w_90,h_90"
        }],
      iNow: null,
      isPlay: false
    };
  },
  components: {
    Music
  }
};
}
</script>
#music{
    width: 400px;
    height: 600px;
}

对事物如何工作的详细解释,看看指南.