首页 > 解决方案 > v-select 与过滤剂量工作

问题描述

我创建了一个 v-select 但我想过滤我将显示的内容

这是我的html:

<v-select
  :items="formaPagamentoList"
  :filter="filtarFormaPagamento"
  item-text="nome"
  v-model="formPagamentoSelecionada"
  item-value="id"
  placeholder="Selecione uma Forma de Pagamento"
  single-line
  ></v-select>

这是我的 js

data: () => ({
    formPagamentoSelecionada: null,
    totalAdicionado: 0,
    valorInformado: null,
    formaPagamentoList: [],
    formPagamentoAdicionada: [],
    alert: false,
    filtarFormaPagamento(item, queryText, itemText) {
      console.log('hi');
      return item.credito;//this is a boolean prop in my object
    },
  }),

我的“嗨”不会显示在控制台中,并且我的选择没有被过滤。

tks

标签: vue.jsvuetify.js

解决方案


似乎它目前是一个错误(v.1.0.17),并且没有autocomplete道具就无法工作。

在此处跟踪相关的 github 问题:
https ://github.com/vuetifyjs/vuetify/issues/3815


推荐阅读