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

@devops-web/cs-multiple-search

v3.0.0-beta.3

Published

[更新日志](./CHANGELOG.md)

Downloads

147

Readme

common-ui 公共组件库

更新日志

更新流程

  1. 切换源到npm官方源https://registry.npmjs.org/
  2. npm login
  3. 使用npm version patch修改package.json中的版本号
  4. npm publish

组件开发流程

  1. 将已经开发完成的组件放入全局组件工程src\package
  2. 将组件注册到src\package\index.js文件中

使用方法

npm i @devops-web/cs-multiple-search

全局引入

import Vue from "vue";
import CsMultipleSearch from "@devops-web/cs-multiple-search";
import "@devops-web/cs-multiple-search/lib/cs-multiple-search.css";
Vue.use(CsMultipleSearch);
- no-collect 不需要收藏,默认false

options

- filterable 是否显示搜索按钮
- showCheckAll 是否显示全选按钮
- width 宽度
- value 查询字段名称
- label 查询展示名称
- items 查询条件
<template>
  <cs-multiple-search
    :options="options"
    :collects-method="getCollects"
    :delete-collect-method="onDeleteCollect"
    :add-collect-method="onAddCollect"
    @search="onSearch"
  ></cs-multiple-search>
</template>

<script>
export default {
  data() {
    return {
      options: [
        {
          label: "需求类型",
          value: "type",
          type: "multiple",
          items: [
            { label: "史诗", value: 0 },
            { label: "特性", value: 1 },
            { label: "用户故事", value: 2 },
          ],
        },
        {
          label: "状态",
          value: "status",
          type: "multiple",
          filterable: true,
          width: 300,
          items: [
            { label: "未开始", value: 0 },
            { label: "开发中", value: 1 },
            { label: "开发完成", value: 2 },
            { label: "测试中", value: 3 },
            { label: "测试完成", value: 4 },
            { label: "已关闭", value: 5 },
            { label: "已关闭", value: 6 },
            { label: "已关闭", value: 7 },
            { label: "已关闭", value: 8 },
          ],
        },
        { label: "创建时间", value: "createTime", type: "daterange" },
        {
          label: "创建人",
          value: "creator",
          type: "multiple",
          showCheckAll: false,
          filterable: true,
          width: 300,
          items() {
            return Promise.resolve([
              { label: "高", value: 0, extra: "中间件中间件中间件" },
              { label: "中", value: 1, extra: "中间件中间件" },
              { label: "低", value: 2, extra: "中间件" },
            ]);
          },
        },
      ],
    };
  },
  methods: {
    onSearch(formData) {
      console.log("--------formData-------->", formData);
    },
    getCollects() {
      // 获取保存的搜索
      return Promise.resolve([
        {
          label: "条件1",
          condition: [
            {
              key: "type",
              value: [0, 1],
            },
          ],
        },
        {
          label: "条件1",
          condition: [
            {
              key: "type",
              value: [0, 1],
            },
          ],
        },
      ]);
    },
    onAddCollect(label, condition) {
      // 保存搜索
      console.log("---------------->", label, condition);
      return Promise.resolve();
    },
    onDeleteCollect(data) {
      //  删除搜索
      console.log("---------------->", data);
      return Promise.resolve();
    },
  },
};
</script>