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

ddmarketing-common-filter

v1.0.4

Published

A common filter

Downloads

2

Readme

common-filter 组件

安装依赖

npm i ddmarketing-common-filter

开始使用

main.js文件中引入并注册
import selfFilter from 'ddmarketing-common-filter'
Vue.use(selfFilter)

参数说明

dialogshow:控制filter弹出层的显示与隐藏,初始化置为false
items:filter可选参数列表,初始化置为空数组,该参数内容会在init事件中从接口获取并做相应处理,具体操作参考下面#如何使用#
filterdb:初始化置为空数组,该参数存储已选择filter的相应内容,在查询操作时取其content即为查询条件
init:初始化方法,在其内调用接口获取filter初始列表并需要对其做相应操作
Apply:提交操作,在执行查询时调用该方法在其内做相应的调用接口和取值的操作

如何使用

<template>
  <div>
        <selfFilter
          :dialogshow.sync="showfiltertt"
          :filterdb.sync="filterdbtt"
          :items.sync="itemstt2"
          @Apply="applyf"
          @init="init"
        ></selfFilter>
  </div>
</template>

<script>
export default {
  data(){
    return{
      showfiltertt: false,
      filterdbtt: [],
      itemstt2: [],
    }
  },
  methods:{
    init () {
      //调用接口获取部分数据
      taskSupportfilter().then((res) => {
        //以下为固定操作,需要对数据进行处理才能正常使用
        res.content.forEach(item => {
          if (item.type == "number" || item.type == "date") {
            item.label = ""
            item.originlabel = ""
            item.value1 = ""
            item.value2 = ""
            item.originvalue1 = ""
            item.originvalue2 = ""
          } else if (item.type == "string" || item.type == "selection" || item.type == "setSelection") {
            item.label = ""
            item.originlabel = ""
            item.value1 = []
            item.originvalue1 = []
          } else if (item.type == "bool") {
            item.label = ""
            item.originlabel = ""
            item.value1 = ""
            item.originvalue1 = ""
          }
        })
        this.itemstt2 = res.content
      })
    },
    applyf () {
      //filtertask为调用查询接口需要的参数,如下操作所示从filterdbtt的content取
      this.filtertask = []
      for (let i = 0; i < this.filterdbtt.length; i++) {
        this.filtertask.push(this.filterdbtt[i].content)
      }
      //调用查询接口
      this.getTasks()
    },
  },
}
</script>

特别说明

该组件还需要依赖element UI和亚马逊字体图标库
字体图标库需要引入的依赖如下:
    "@fortawesome/fontawesome-free": "^6.0.0",
    "@fortawesome/fontawesome-pro": "^6.0.0",
    "@fortawesome/fontawesome-svg-core": "^1.3.0",
    "@fortawesome/free-brands-svg-icons": "^6.0.0",
    "@fortawesome/free-regular-svg-icons": "^6.0.0",
    "@fortawesome/free-solid-svg-icons": "^6.0.0",
    "@fortawesome/pro-duotone-svg-icons": "^6.0.0",
    "@fortawesome/pro-light-svg-icons": "^6.0.0",
    "@fortawesome/pro-regular-svg-icons": "^6.0.0",
    "@fortawesome/pro-solid-svg-icons": "^6.0.0",
    "@fortawesome/vue-fontawesome": "^2.0.6",
main.js里面引入即可:
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/pro-solid-svg-icons'
import { far } from '@fortawesome/pro-regular-svg-icons'
import { fal } from '@fortawesome/pro-light-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'