vue-route-sync-plugin2
v1.0.0-beta.14
Published
   
+ component
<script>
export default {
data() {
return {
pagination: {
pageSize: 10,
pageNum: 1
},
routeSync: {
ps: "pagination.pageSize",
pn: "pagination.pageNum",
}
};
}
};
</script>API
createRouteSyncMixin
A series of mixins is automatically generated for the url synchronization function
Parameters
options{{}} A map of $route.query keys to vm's property pathoptions.KeyOfOptions{string} Key of options is the value key on url query string, and its also the key in vm.$routeoptions.ValueOfOptions{string} Value of options is a path to find the actual value in vm
Returns {} A series of mixins
processEscapeStr2Value
process escape string to value with its data type
Parameters
str{string}
Returns (string | any | undefined | number)
processValue2EscapeStr
process value to escape string
Parameters
val{any}
Returns string
TODO
- write demo
License
This project is licensed under the MIT license.
