dexie/Dexie.js

How to use liveQuery() in Vue with reactive query paramters

Open

#1.528 geöffnet am 31. März 2022

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (10.304 Stars) (625 Forks)batch import
contribution wantedgood first issue

Beschreibung

I want to implement a pagination, Did Vue have reactive query variable like React hooks useLiveQuery() second parameter deps?

const limit = ref(50);
const items = useObservable(liveQuery(
        () =>
         db.orderBy("creat")
            .limit(limit.value)  // the limit is reavtive ref, but change limit not triger the items change.
            .toArray()
      ))

Contributor Guide