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

ad-filter

v0.1.9

Published

基于vue的高级筛选组件

Readme

advanced-filter

安装

npm install ad-filter

引入

main.js

import AdFilter from 'ad-filter' 
import 'ad-filter/lib/ad-filter.css'

demo.vue

<template>
  <div id="app">
      <adFilter :config="tagTable" @doFilter="search" />
  </div>
</template>

Attributes

| 参数 | 说明 | 类型 | 默认值 | | :------------ |:---------------:|:-----|----| | config | 配置项 | Array |[]| | separator | 多选状态下参数间的分隔符 | String|;|

Events

| 事件名称 | 说明 | 回调参数 | | :------------ |:---------------:|----| | doFilter | 点击筛选时触发 | 导出的筛选参数(Object) |

Config参数详解

参数示例:

[
	{
		key: 'type',
		content: '类型',
		multiple: true,
		type: 'select',
		separator: 'QQQ',
		color: 'red',
		background: '#0f0faa',
		options: [
			{
				label: '类型1',
				value: 'type1' 
			},
			{
				label: '类型2',
				value: 'type2' 
			}
		]
	},
	{
		key: 'status',
		content: '状态',
		multiple: false,
		type: 'select',
		options: [
			{
				label: '状态1',
				value: 'status1' 
			},
			{
				label: '状态2',
				value: 'status2' 
			}
		]
	},
	{
		key: 'keyword',
		content: '关键字',
		type: 'input'
	},
	{
		key: 'dateRange',
		content: '日期范围',
		type: 'dateRange',
		multiple: false
	},
	{
		key: 'date',
		content: '日期',
		type: 'date',
		multiple: true
	}
]

参数说明:

config数组中,每一个object都代表要配置的可供选择的参数项,object中参数具体解析如下:

config:

| 事件名称 | 说明 | 类型 |可选值| | :------------ |:---------------:|----|----| | key | 筛选参数的key值(必须唯一) | String || | content | 该参数展示在组件上的名称 | String || | type | 筛选项类型 | String |"select","input","date","dateRange"| | multiple | 是否多选 | Boolean |true、false (默认false)| | separator | 多选时多个值之间的分隔符(仅在多选时有效) | String |在未指定时使用外部传入的attribute中公共的separator参数| | options | 下拉选项(仅在type为"select"时可用) | Array ||| | color | 标签字体颜色(不设定则取用默认颜色)| String ||| | background | 标签背景色(不设定则取用默认颜色) | String |||

type:

| 类型名称 | 说明 | | :------------ |:---------------:| | select |单选、多选类型筛选项,需配置options参数| | input |输入类型参数| | date |日期类型参数| | dateRange |日期范围类型参数|

options:

options仅在type为select类型的选项中可用:

示例:
options: [
	{
		label: '状态1',
		value: 'status1' 
	},
	{
		label: '状态2',
		value: 'status2' 
	}
]

| 参数 | 说明 | | :------------ |:---------------:| | label |该选项展示的文字| | value |选项的值|