vue-use-route-query icon indicating copy to clipboard operation
vue-use-route-query copied to clipboard

Support for object?

Open mortal-link opened this issue 10 months ago • 0 comments

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

mortal-link avatar Jan 13 '25 08:01 mortal-link