vue-route-values
v0.1.0
Published
A set of simple components to manage route and query params using Vue Router.
Downloads
2
Maintainers
Readme
vue-route-values
A set of simple components to manage route and query params using Vue Router.
Install
yarn add vue-route-values
or
npm install vue-route-values --save
And that's all! Here you have a simple usage example.
<template>
<RouteQueryValue
#default="{ value, set }"
:encode="x => String(x)"
:decode="x => Number(x)"
name="page"
:defaultValue="1"
>
<div class="paginator">
<a @click="set(value - 1)">prev</a>
<div>{{ value }}</div>
<a @click="set(value + 1)">next</a>
</div>
</RouteQueryValue>
</template>
<script>
import { RouteQueryValue } from 'vue-route-values'
export default {
name: 'RouteQueryValueExample',
components: { RouteQueryValue },
}
</script>