Filter the options in the Vue Multiselect component by using the filter() method

This component and API can be found at https://github.com/vueform/multiselect

Event Attributes Description
@search-change query, select$ Emitted after a character is typed.

I am trying to access select$.filteredOptions

  methods: {
    inputQuery(query, select$){
      console.log(query, select$);
    },

When I log in the console: "query"- these are the symbols I inputted "select$" - shows as undefined, but it should represent the "proxy" of this select

It seems like this issue may have occurred because Multiselect was called through an intermediary component.

<SelectComponent v-model="countryId" :options="countries" />    
    

#SelectComponent.vue

<Multiselect
      :options="options"
      @search-change="inputQuery"

Props and events are passed here so that it works for all selects in the app
Any suggestions on how to get "select$" to display properly?

Even emitting events does not solve the issue for me

<SelectComponent  @searchChange="inputQuery2" />

 methods: {
    inputQuery2(query,select$){
      console.log(query,select$);
    },

#SelectComponent.vue

<Multiselect
    @search-change="inputQuery"

emits: ['search-change'],   
methods: {  
    inputQuery(query,select$){
      this.$emit('search-change', query, select$);
    },

Answer №1

It appears that you are utilizing the async promise version of the Multiselect component entry.

To address this, consider modifying your method configuration to accommodate the async operation: (also be aware that there was an omission of a spacebar after 'query,')

methods: {
async handleQuery(query, select$) {

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method for performing a spelling check on every property within an array of Objects?

I'm working on a program that takes a user input as an argument and then searches for a similar match in an array of objects. The array of objects is retrieved from a database. When the user inputs a name, the search criteria should find objects with ...

Load components in NextJS lazily without utilizing `next/dynamic`

Currently, I am in the process of developing a component (Editor) that should always be lazy-loaded in React applications. However, I need it to be compatible with any React app. While I have successfully implemented lazy loading with Create React App usi ...

The project is throwing an error: Unable to locate module './lib/md5-hex' in Ember JS

I attempted the following steps: uninstalling md5-hex using npm with the command: npm uninstall md5-hex --save reinstalling md5-hex using npm with the command: npm install md5-hex --save After performing these actions, I ran ember s but unfortunately, i ...

Selecting DigitalOcean city based on user location in Node.js

Currently, I am implementing Node.js in conjunction with my HTTP server. My goal is to have every user who connects to the server be linked to a real-time game server through WebSockets. Furthermore, I aim for users to automatically connect to the nearest ...

Is there a way to access the Flask global in AngularJS?

I'm in the process of developing an internal web application using Flask that connects to various clusters. The majority of the URLs begin with /cluster/cluster_name, which is why I've implemented the following code in my blueprints: cluster = B ...

Exploring Angular 2 Tabs: Navigating Through Child Components

Recently, I've been experimenting with trying to access the HTML elements within tabs components using an example from the Angular 2 docs. You can view the example here. Here is a snippet of my implementation: import {Component, ElementRef, Inj ...

Discovering the children of the target DOM element in React

Imagine you have an HTML unordered list that you want to turn into a React element: <ul id="mylist"> <li><a href="">Something</a></li> <li><a href="">Another thing</a></li> <li><a ...

Prevent reloading the page when adding a flash element using JavaScript (jQuery)

Here is the function I am working with: function onVideo(vchat, idUser){ $('#videollamada').html('<div class="videollamada">'+ '<div align="right">'+ ...

Exploring the Component API in VueJS 3 with Typescript: Learn how to assign a class to a template ref

Is there a recommended way to add/remove CSS classes from a template ref using the Vue 3 Composition API and typescript? When trying to use modal.value, I encountered the following typescript errors: const modal = ref(null) results in Object is possibly ...

Unable to render Row using MySQL in conjunction with ReactJS

Recently, I started working on developing a table using ReactJS on the FrontEnd, NodeJS on the BackEnd, and MySQL for the database. I am trying to retrieve data based on a Select request using the primary key (Code) from the list. https://i.sstatic.net/tXP ...

Uncover the secrets of HTML with JavaScript

I'm facing an issue with extracting data from a link's data attribute and trying to decode the HTML within it, but unfortunately, it's not functioning as expected. Check out my code on JSFiddle: http://jsfiddle.net/Kd25m/1/ Here's the ...

The scrollIntoView feature of JavaScript is unable to scroll an element to the exact top of the scrolling

Vue is the framework I am utilizing for my current project. JavaScript: let captureElement = document.getElementById('tag' + (index - 1)); if (captureElement) { captureElement.parentNode.scrollIntoView({behavior:"smooth",block: "start", inl ...

Learn how to incorporate latitude and longitude coding into PHP to display a map icon that correctly redirects to the desired URL when clicked

I am in need of a table that includes buttons for adding, editing, deleting, and mapping. Everything works fine so far, but when I click on the map button, it should take me to Google Maps with coordinates linked from a MySQL database containing latitude ...

What is the trick to positioning the dice above the green circle and below the line, as shown in the image?

I'm struggling to position the large green circle and the dice image on top of each other as well as below each other. How can I achieve the desired layout shown in this image? Here's what I have managed to do so far https://i.sstatic.net/ryIPl.p ...

What is the correct method to authenticate a user's ID token in Firestore with Javascript?

I am in the process of developing a react native application and have integrated Firebase, specifically firestore, for data management purposes. My current goal is to incorporate an automatic login feature in my app, where users remain signed in even after ...

Issues with Imported Routes Not Functioning as Expected

I am currently working on implementing routing in my Angular 2 project. All the components are functioning properly, but I encounter an error when I include 'appRoutes' in the imports section of app.module.ts. An unexpected TypeError occurs: C ...

"Utilizing Jquery for interactive menu functionality - delivering the requested JSON

I have successfully implemented a dynamic menu using jQuery that parses a JSON response file to create the menu. However, instead of having the menu items link to URLs, I want them to retrieve and parse JSON data from those URLs. Despite my efforts, the me ...

Issue with vueform/multiselect component when used as a single file component

I've been encountering some unusual errors while attempting to integrate vueform/multiselect. Most of the examples I've come across don't make use of single-file components, but that's the method I prefer. My goal is to import the Multi ...

Manipulate your table data with jQuery: add, update, delete, and display information with ease

When adding data dynamically to the table and attempting to edit, the checkbox value is not updating. This issue needs to be resolved. You can view the code in action on jsFiddle here on JSFiddle ...

What is the process for dynamically inserting a new object into an array of data objects in Vue.js?

I am a beginner with vue.js and currently working on a form. I have an add button in my form, so when the user clicks on it, the same form field will be added to the form. Users can add as many times as they want. Here is my initial data: data () { ret ...