{"id":20301290,"url":"https://github.com/indentno/vue-url-parameters","last_synced_at":"2025-07-17T19:36:01.266Z","repository":{"id":80729084,"uuid":"98990519","full_name":"indentno/vue-url-parameters","owner":"indentno","description":"A vue mixin that simplifies working with url parameters. The package is developed for the purpose of allowing the key and values of a vue filter to be defined with url parameters.","archived":false,"fork":false,"pushed_at":"2018-01-16T09:59:17.000Z","size":13,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T16:12:25.534Z","etag":null,"topics":["js","mixin","parameters","url","url-parameters","vue","vue-mixin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indentno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-01T10:43:13.000Z","updated_at":"2024-11-08T14:21:36.000Z","dependencies_parsed_at":"2023-06-14T17:15:37.852Z","dependency_job_id":null,"html_url":"https://github.com/indentno/vue-url-parameters","commit_stats":null,"previous_names":["sempro/vue-url-parameters"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indentno%2Fvue-url-parameters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indentno%2Fvue-url-parameters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indentno%2Fvue-url-parameters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indentno%2Fvue-url-parameters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indentno","download_url":"https://codeload.github.com/indentno/vue-url-parameters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410140,"owners_count":21098772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["js","mixin","parameters","url","url-parameters","vue","vue-mixin"],"created_at":"2024-11-14T16:25:09.380Z","updated_at":"2025-04-11T13:36:06.292Z","avatar_url":"https://github.com/indentno.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-url-parameters\n\n[![Latest Version on NPM](https://img.shields.io/npm/v/vue-url-parameters.svg?style=flat-square)](https://npmjs.com/package/vue-url-parameters)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n\nA vue mixin that simplifies working with url parameters. The package is developed for the purpose of allowing the key and values of a vue filter to be defined with url parameters.\n\n## Install\n\n**Public package installation**\n\nYou can install the package via npm:\n\n```bash\n$ npm install vue-url-parameters\n```\n\n## Usage\n\nImport the package into your vue component.\n```js\nimport vueUrlParameters from 'vue-url-parameters';\n```\n\nApply the mixin:\n```js\nmixins: [vueUrlParameters],\n```\n\nRetrieve values from url on component init:\n```js\n// searchParams should be replaced with an object containing your properties\nthis.searchParams = this.getFiltersFromUrl(this.searchParams);\n```\n\nTrigger update of url hash when a filter changes, or in the method responsible for sending a request.\n```js\nthis.updateUrlHash(this.searchParams);\n```\n\n**Example structure of an object (searchParams) that can be used with this package.**\n```js\ndata() {\n  return {\n    searchParams: {\n      q: null,\n      type: 'all'\n    }\n  }\n}\n```\n\n### Casting of attributes\n\nWhen you fetch attributes from the url, you can pass in a second parameter to the `getFiltersFromUrl()` function in order to case the attributes automatically:\n\n```js\nthis.getFiltersFromUrl(this.searchParams, true)\n```\n\nStrings that can be cast to a numeric value will be cast to a float. Strings that equals either *true* or *false* will be cast to a boolean.\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ npm run test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please contact [admin@sempro.no](mailto:admin@sempro.no) instead of using the issue tracker.\n\n## Credits\n\n- [Runar Jørgensen](https://github.com/ventrec)\n- [Christoffer Martinsen](https://github.com/mrtnsn)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findentno%2Fvue-url-parameters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findentno%2Fvue-url-parameters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findentno%2Fvue-url-parameters/lists"}