API

dynamicQueryState

A useQueryStates entry whose keys come from runtime definitions.

Hover the name for its full signature.

import { 
dynamicQueryState
} from '@chronicstone/vue-route-query'

Options

OptionTypeDescription
urlPrefixstringPrefix for every key this entry owns, after the group prefix.
definitions() => TDefinition[]The definitions that exist when the group reads or writes.
resolve(definition) => { urlKey: string; codec }[]Every key one definition may use, with its codec. The codec's rules apply; its default and write options are not used.
parse(entries: ReadonlyMap<string, unknown>, definitions) => TValueBuilds the value from the accepted entries. Rejected entries are left out and reported in issues.
serialize(value, definitions) => Map<string, unknown>Maps the value back to entries. Keys left out are removed.
defaultTValueThe value when no accepted key is present.

Returns

A schema entry for useQueryStates. It is not reactive by itself. See Dynamic keys for a full example.

Copyright © 2026 Cyprien Thao. Released under the MIT License.