Skip to content
On this page

quick-filter

1.screenshot example

View demo

2.type quick-filter code

Click me to view the code
vue
<script setup>
import { ref } from 'vue'
import { EverrightFilter } from 'everright-filter'
import 'everright-filter/dist/style.css'
const ERfilterRef = ref(null)
const lang = ref('en')
const handleListener = ({ type, data }) => {
}
const getOptions = async () => {
  return new Promise((resolve, reject) => {
    resolve({
      data: {
        options: [
          {
            label: '客户名称',
            en_label: 'Customer name',
            value: 'input_NYF_NaWIL1ezQeje19fO5',
            operatorKey: 'input',
            renderType: 'TEXT',
            includeOperator: {
              operator: [
                'contains'
              ]
            }
          },
          {
            label: '客户编号',
            en_label: 'Customer ID',
            value: 'input_4FbXNPc1ValSmbVZ4X03i',
            operatorKey: 'input',
            renderType: 'TEXT',
            includeOperator: {
              operator: [
                'contains'
              ]
            }
          },
          {
            label: '富文本编辑器',
            en_label: 'rich text editor',
            value: 'html_doavWMEKsA04CBVc2qkvB',
            operatorKey: 'input',
            renderType: 'TEXT',
            includeOperator: {
              operator: [
                'contains'
              ]
            }
          }
        ],
        operators: {
          input: [
            {
              value: 'contains',
              style: 'noop'
            }
          ]
        }
      }
    })
  })
}
</script>
<template>
  <div>
    <EverrightFilter
      :lang="lang"
      :getOptions="getOptions"
      type="quick-filter"
      @listener="handleListener"
      ref="ERfilterRef"/>
  </div>
</template>

3.API

Attributes

NameTypeDescriptionAccepted ValuesDefault
httpParamsObjectDefine filter four interfaces-Refer to the demo
typeStringDefine filter type-linear|matrix|quick-search|quick-filter
langStringi18nzh-cn|enzh-cn
isShowValidateStateBooleanWhether to display the verificationtrue|falsetrue
ruleLimitNumberDefine the number of filter conditions--1
getOptionsFunctionDefine API options data--
getConditionsFunctionDefine API conditions data--
getPropsFunctionDefine API props data--
getPropValuesFunctionDefine API propValues data--

Exposes

NameDescriptionParameters
setDataSet data-
getDataGet data, internal verificationtrue|false Whether to verify
clearDataClear filter conditions or clear value-

Event

NameDescription
listenerAll events inside the filter are sent through this event, distinguished by type

type:

  • init

    trigger rendering end