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

@goldnet/component

v0.0.4

Published

以主流浏览器为主,兼容IE8.

Downloads

16

Readme

审核组件

以主流浏览器为主,兼容IE8.

VUE2、VUE3 使用

安装

npm i @goldnet/component

使用

import { ReviewProcess, a } from '@goldnet/component';

//vue2,mounted中查找节点,添加。_props为组件的属性,具体看下方
mounted(){
	const div = document.getElementById('customDiv');
	if (div) {
		a(ReviewProcess(_props), div);
	}
}
//vue3, onMounted回调中查找节点,添加。
onMounted(() => {
	// 如上
})

Layui & Script 标签使用

安装

npm获取引入的js, 如dist/index.iife.jshttps://unpkg.com/@goldnet/component/dist/index.iife.js

使用

<script src="https://unpkg.com/@goldnet/component/dist/index.iife.js"></script>
<script>
	const ele = document.getElementById('content');
	goldnet.h(goldnet.ReviewProcess(_props), ele) ;// _props 见下方说明
</script>

Props属性

source

【必选】要展示的数据

var source = [
	{
		status: "1",
		desc: "审核中1",
		label: "企业经办人 张三1",
		datetime: "2021-10-10 10:10:10"
	}
];
/*
status
  [必选]审核状态码,  预设的值(1:提交申请 2:审批同意 3:审批驳回 4:审批拒绝)
desc:
  [可选]审核建议描述,
label:
  [可选]审核人标签, 如:"企业经办人 张三1",
datetime:
  [可选] 日期,支持三种形式,如:
  时间日期字符串 : "2021-10-10 10:10:10",
  时间戳(毫秒): 1710316054000,
  时间戳(秒):1710316054
*/

statusConfig

自定义状态文字和颜色 对映source的status字段

/*
color
  [可选] 状态颜色,支持:success、processing、error、default、自定义颜色对象{color: string;borderColor?: string;background?: string;}
label:
  [可选] 审核状态,
*/
var statusConfig = {
	"1": {
		color: "processing",
		label: "提交申请",
	}
}

hideTag

是否隐藏标签 默认false

{ source: source, statusConfig: statusConfig,hideTag:true };

完整的案例

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>review-process</title>
</head>

<body>
	<div id="content">

	</div>
	<script>
		var source = [
			{
				status: "1",
				desc: "审核中1",
				label: "企业经办人 张三1",
				datetime: "2021-10-10 10:10:10", // 时间日期字符串
			},
			{
				status: "2",
				desc: "审核中2",
				label: "企业经办人 张三2",
				datetime: 1710316054000, // 时间戳(秒)
			},
			{
				status: "3",
				desc: "审核中3",
				label: "企业经办人 张三3",
				datetime: 1710316054, // 时间戳(秒)
			},
			{
				status: "4",
				desc: "审核中4",
				label: "企业经办人 张三4",
				datetime: "2024-10-10 10:10:10"
			},
			{
				status: "5",
				desc: "审核中5",
				label: "企业经办人 张三5",
				datetime: "2025-10-10 10:10:10"
			},
		];

		var statusConfig = {
			"1": {
				color: "processing",
				label: "提交申请",
			},
			"2": {
				color: "success",
				label: "审批同意",
			},
			"3": {
				color: "error",
				label: "审批驳回",
			},
			"4": {
				color: "default",
				label: "审批拒绝",
			},
			"5": {
				color: { color: "#ff00ff", background: "#000000", borderColor: 'red' },
				label: "审批拒绝",
			}
		}
		// 属性定义
		var _props = { source: source, statusConfig: statusConfig, style: { textAlign: 'left' } };

	</script>

	<!-- 引入兼容库-->
	<script src="https://unpkg.com/@goldnet/component/dist/libs/minified.min.js"></script>
	<script src="https://unpkg.com/@goldnet/component/dist/index.iife.js"></script>
	<script>
		goldnet.h(goldnet.ReviewProcess(_props), document.getElementById('content'))
	</script>
</body>

</html>