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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-simple-autocomplete

v0.9.10

Published

Simple autocomplete for Vue 2

Readme

Vue Simple Autocomplete

Compatible with Vue 2.x

Installation

yarn add vue-simple-autocomplete

Use

This component is used as a base to create your own autocomplete. For example, If I need to create an autocomplete for originProcesso, I would create my component originProcessoAutocomplete, like this:

<template>
  <div>
    <VueSimpleAutocomplete
      :items="originsProcess"
      :selected-item="originProcesso"
      @change="searchOrigins"
      @value-selected="onOriginSelected"
      :is-loading="loadingOrigins"
      :get-display-value="displayOrigin"
      :min-length="2"
      placeholder="Type to search"
    ></VueSimpleAutocomplete>
  </div>
</template>

<script>
import originProcessApi from "../../services/api/originProcessApi";
import VueSimpleAutocomplete from "vue-simple-autocomplete";

export default {
  name: "originProcessoAutocomplete",
  components: {
    VueSimpleAutocomplete,
  },
  model: {
    prop: "originProcesso",
    event: "change",
  },
  props: {
    originProcesso: Object,
  },
  data() {
    return {
      originsProcess: [],
      loadingOrigins: false,
    };
  },
  created() {
    this.originProcessApi = new originProcessApi();
  },
  methods: {
    async searchOrigins(name) {
      try {
        this.originsProcess = [];
        this.$emit("change", {});

        if (name == null || name.length === 0) {
          return;
        }
        this.loadingOrigins = true;
        this.originsProcess = await this.originProcessApi.getOriginProcessAutocomplete(
          name
        );
        this.loadingOrigins = false;
      } catch (err) {
        this.loadingOrigins = false;
      }
    },
    onOriginSelected(origin) {
      this.$emit("change", origin);
    },
    displayOrigin(origin) {
      if (origin && origin !== "" && origin.name) {
        return origin.name;
      }

      return "";
    },
  },
};
</script>

<style lang="scss" scoped></style>

Props

  • items: Array of items to display on the list showed by the autocomplete. Usually the result of an api query. Default is [].

  • isLoading: Boolean value indicating if a search is being made. When this value is true, the autocomplete will show the message provided with isLoadingMessage. Default is false.

  • isLoadingMessage: String value showed when isLoading is true. Default is Carregando resultados....

  • noResultsMessage: String value showed when items is empty. Default is Nenhum resultado encontrado.

  • getDisplayValue: Function that receives the selected item from items. It should return a string value that will be showed on the input in the autocomplete. Default is (item) => item.

  • selectedItem: The selectedItem from items. Default is {}.

  • minLength: Number indicating the minimum number of characters for the autocomplete to start a search. Default is 1.

  • placeholder: Placeholder string for the input in the autocomplete.

Events

  • change: event triggered when an input of the minLength specified is provided. It receives the value of the input.

  • value-selected: event triggered when a value is selected in the autocomplete. It receives the value selected.

License

MIT License