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

multiple-search-input

v1.1.11

Published

It is based on vue-bootstrap-typeahead and supported multiple added tags.

Downloads

66

Readme

Tag-Input

示例

基于vue-bootstrap-typeahead二次开发组件,支持输入多个tag和tag的远程搜索组件。

特别注意

  • 需要vue-property-decorator, vue-class-component, bootstrap的b-form-tags全局注册

usage

组件方式

import { MultipleSearchInput } from 'multiple-search-input' 
Vue.component('MultipleSearchInput', MultipleSearchInput) 

插件方式

import { multipleSearchInputPlugin } from 'multiple-search-input'
Vue.use(multipleSearchInputPlugin);

Prop

| prop | type | description | | :---- | :---- | :---- | | limit | Number | 限制tag的个数 | | list | {text: string; value: T} | 下拉选择 | | options | {text: string; value: T} | 初始下拉(当是远程搜索没有初始下拉选择时需要提供,不然value找不到对应显示的text值,当options和list同时有优先选options里面的值) | | label | string | label | | fieldClass | string | 设置整体div的class | | disabled | boolean | disabled | | canFreeText | boolean | 不检查是否在下拉内,可以直接新建tag | | busy| boolean | 使用无限滚动时翻页设置成true,load数据后改成false| | infinite| boolean | 是否采用无限滚动 | | handleValidate | (val: T) => boolean | 控制能否加入tag内 | value [v-model] | T[] | tag的value

Event

| event | type | description | | :---- | :---- | :---- | | fetch-data | (val: string) => void; | 输入之后得到的值(可以在此调用远程搜索api) | | fetch-more-data | (val: string) => void; | 触发滚动到底部的时候触发 | | get-option | (val: {text: string; value: T}[]) => void; | 获取当前已被选中的tag option(对于得不到初始option,在页面返回的时候可以在option中传入) | | blur | () => void; | 当输入后没有匹配或者选择list里面的value,触发失去焦点时(对于远程搜的时候,可以利用这个钩子来清空list) | | change[v-model] | (val: string[]) => void; | |

如何链接到别的包本地调试

  • 运行npm run dev,将package.json中的main改为dist/multipleSearchInput.js, 并运行npm link将包链接到本地全局,再在需要调试的项目运行npm link multiple-search-input。需要调试的项目还需要npm install source-map-loader配置webpack.config

启动命令详解:

  • npm run start: 本地demo启本地服务器
  • nom run dev: 打一个dev环境的js包
  • nom run start:demo: 打一个prod环境的包但不抽离vue,vue-class-component,vue-property-decorator,方便直接引入js,而不是通过npm本地引入
  • nom run build: 打prod包发布新版本
  • pre-publish: 打包并改版本号

组件数据同步流程图

示例