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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bm_search_input

v1.0.0

Published

基于vue的搜索框(包含历史记录和搜索建议列表)

Downloads

7

Readme

bm_search_input

介绍

基于vue3的搜索框,包含存储和删除历史记录以及搜索建议列表,用户可以在配置中选择是否需要历史记录。

展示

在这里插入图片描述

下载

npm install bm_search_input -S

引入

import bm_search_input from 'bm_search_input'

Vue.component('bm_search_input',bm_search_input);

配置

使用示例

template中

 <search_input :isHistory="true"
                  :lists_title="search_result_title"
                  :lists_note="search_result_note"
                  @parent_get_lists="get_selected_lists"
                  @parent_search="finish_search">
    </search_input>

script中

  data(){
        return{
          //搜索结果中的标题
          search_result_title:[],
          //搜索结果中的备注(不需要可以删掉)
          search_result_note:[]
        }
    },
    methods:{
      get_selected_lists(input_content){
        // eslint-disable-next-line no-console
        console.log(input_content);
        //发送请求,获取筛选结果
        this.axios.get('demo.json',{
          params:{
            //将用户输入内容加入参数,其余参数根据需要自行添加
            param1:input_content
          }
        })
          .then((res) => {
            // console.log(res.data);
            //将筛选结果(数组)传入子组件,完成显示
            res.data.forEach((item,index) => {
              this.search_result_title[index] = res.data[index].title;
              this.search_result_note[index] = res.data[index].note;
            })
          })
          .catch((err) => {
            // eslint-disable-next-line no-console
            console.log(err);
          })
      },
      finish_search(input_content){
        console.log(input_content);
        //搜索框显示完成,页面展示搜索结果
        //这里写入你之后想要运行的程序
      }
    }

GitHub

开源地址: bm_search_input. 欢迎star!