vue-use-route-query
vue-use-route-query copied to clipboard
Support for object?
Hi,
I searched many libs for queries, this is the best I have seen in perfection.
I have a lot of query to synchronize in my app. I've tried reactive, but it relies on lots of code, and it's hard to reset.
const state = reactive({
a: useRouteQuery('a', '1'),
b: useRouteQuery('b', '2'),
});
how about this override: map param object properties to useRouteQuery, and make each proxied by the returned object.
const state = useRouteQuery({
a: '1',
b: '2',
})
state.b = '3' // ?a=1&b=3
state.b = undefined // ?a=1
inspired by ahooks.useUrlState