rtucek/vue-query-builder

Rule operators not supported

Closed this issue · 6 comments

Hi,

are rule operators not supported?
For example, for constructing a query: "numA > 3"

Note - these are not the And/Or group operators.

The QueryBuilder doesn't come with any pre-defined/opinionated rules out of the box.
Instead, you're supposed to write and inject your own rules - so it should cover your need for numeric comparison.

Please have a look at the docs for rule configuration as well as the corresponding sample on Code Sandbox. The sample in Code Sandbox shows multiple alternative ways to inject rules as custom components.

Can you please elaborate on your explanation regarding how one might go about doing as Chris asked? The docs for rules configuration and the corresponding sample do not clearly explain how one might create a component that will allow for the alternative caparison values

For example: 'equal','not equal','in','not in','is null','is not null','less','less or equal','greater','greater or equal','between','not between','contains','begins with','ends with'

@mlaw93 & @chrisborecki, please see this sample on code sandbox.
I hope this is what you're looking for.

Edit Slot: Rule (advanced)

@rtucek Thank you for the answers but I believe this is still unclear.

In your example, you filter by the type of the field.
How do you achieve something similar to the screenshot?
Screenshot 2020-10-06 at 18 19 10

Thank you.

This should do the trick
Edit Vegetable

Thank you @rtucek.