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

mysearch-gl

v0.1.0

Published

组件测试

Downloads

5

Readme

作业内容

image-20220607145258996

开发一个autocomplete组件,要求如下:

1、 输入关键字可进行筛选
2、 匹配文字高亮
3、 点击筛选项可补全输入框
4、 组件划分明确
5、 组件、变量、css等命名规范
6、 实现双向绑定
7、 注意css边界
8、 可自行设计预留可配置属性(不强制要求)
9、 样式可自行优化

搜索数据

存放在:my_search/src/data/search.json
[
    {
        "name": "安其拉",
        "id": "a1"
    },
    {
        "name": "安琪",
        "id": "a2"
    },
    {
        "name": "陈仙仙",
        "id": "a3"
    },
    {
        "name": "成小龙",
        "id": "a4"
    },
    {
        "name": "程野",
        "id": "a5"
    },
    {
        "name": "丁小明",
        "id": "d1"
    },
    {
        "name": "丁小龙",
        "id": "a6"
    },
    {
        "name": "丁小野",
        "id": "a7"
    },
    {
        "name": "冯小明",
        "id": "f1"
    },
    {
        "name": "冯小龙",
        "id": "f2"
    },
    {
        "name": "冯小野",
        "id": "a8"
    },
    {
        "name": "⾼小明",
        "id": "g1"
    },
    {
        "name": "⾼小龙",
        "id": "a9"
    },
    {
        "name": "⾼小野",
        "id": "g3"
    },
    {
        "name": "⾼小阳",
        "id": "a10"
    },
    {
        "name": "郭小名",
        "id": "a11"
    },
    {
        "name": "黄小明",
        "id": "a12"
    },
    {
        "name": "黄小龙",
        "id": "a13"
    },
    {
        "name": "黄小野",
        "id": "a14"
    },
    {
        "name": "郝小阳",
        "id": "h4"
    },
    {
        "name": "郝小名",
        "id": "a15"
    },
    {
        "name": "李⼩明",
        "id": "a16"
    },
    {
        "name": "李小龙",
        "id": "a17"
    },
    {
        "name": "李小野",
        "id": "a18"
    },
    {
        "name": "李小阳",
        "id": "a19"
    },
    {
        "name": "李小⼀",
        "id": "a20"
    },
    {
        "name": "李小⼆",
        "id": "a21"
    },
    {
        "name": "李小三",
        "id": "a22"
    },
    {
        "name": "李小四",
        "id": "a23"
    },
    {
        "name": "李⼩五",
        "id": "l9"
    },
    {
        "name": "李华尔",
        "id": "a24"
    }
]

两个路由组件和5个普通子组件,将搜索组件细化

Home.vue  根路由组件  有两个子路由组件MySearchLogo.vue、HomeSearchBar.vue。通过在input框输入内容按会车键或者点击按钮,跳转到Search.vue路由组件,并将输入内容通过params传参过来。my_search/src/common/Util.js封装公共的编程式路由函数

image-20220607150356360

Search.vue路由组件包含两个子组件SearchResultToolBar.vue、SearchResultItem.vue。SearchResultItem组件封装查询出来的每一个item项,SearchResultToolBar又包含子组件RoundSearchBar.vue

image-20220607152315844