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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-easy

v0.1.4

Published

Quick vue component generation

Downloads

1

Readme

vue-easy

帮助你快速创建自己的vue组件库,提供了快速开发、测试、打包和生成文档的组件环境。

安装

npm install -g vue-easy

使用

创建组件库项目

vue-easy create app-component
cd app-component

添加组件

vue-easy add my-input

”my-input“ 为组件名,组件创建好后尽量不要手动修改名字,如果需要废弃,可以通过下面移除组件命令进行移除

移除组件

vue-easy remove my-input

打包组件库

npm run dist

组件打包完毕后可以提交到 npm 等包管理器。

文档

查看开发文档

npm run dev

打包开发文档

npm run build

引用

项目如何引入组件?在组件库中提供了多种方式,以组件库为app-component为例。

1.直接引入

<template>
  <div id="app">
    <myInput/>
  </div>
</template>

<script>
import myInput from "app-component/lib/components/my-input"

export default {
  components: {
    myInput,
  }
}
</script>

2.babel插件按需加载(推荐)

npm install babel-plugin-import

babel.config.js

module.exports = {
  plugins: [
    [
      "import",
      {
        "libraryName": "app-component",
        style: (name) => {
          return 'app-component/lib/styles/' + name.split("\/").pop() + '.css'
        },
      }
    ]
  ]
}

注意替换app-component。

项目中使用

<template>
  <div id="app">
    <myInput/>
  </div>
</template>

<script>
import myInput from "app-component";

export default {
  components: {
    myInput,
  }
}
</script>

说明

主要目录说明:

- app-component
	- components // 主要开发目录
		- example-button // 组件例子
		- component.json // 自动生成的配置文件(自动生成)
		- entry.js 		 // 自动生成的入口配置(自动生成)
		- index.js		 // 全局组件注册文件(无需编辑)
		- index.md		 // 开发文当的准备说明文档
	- ...