Skip to content

A Vue2.x directive to update your query strings after each input and sync your form elements with your search bar to having refresh-proof forms.

Notifications You must be signed in to change notification settings

kaangokdemir/vue-query-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Query Sync

License: MIT npm package downloads size

A Vue2.x directive to update your query strings after each input and sync your form elements with your search bar to having refresh-proof forms.

Installation

npm i vue-query-sync

Dependencies

  • VueJs 2.6.x
  • Vue Router 3.x

Usage

import VueQuerySync from 'vue-query-sync'

Vue.use(VueQuerySync)

// or

Vue.directive('query', VueQuerySync)
<!-- Automatically adds ?state=myValue query after typing. -->
<input v-query="country" />

<!-- Automatically adds ?city=myValue query after typing and two way binds the input value with query string. -->
<input v-query:sync="city" />

For More, please check the Example

Build

npm run build

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Contributors

Kaan Gökdemir - Author (@kaangokdemir) - kaangokdemir.com

License

MIT

About

A Vue2.x directive to update your query strings after each input and sync your form elements with your search bar to having refresh-proof forms.

Resources

Stars

Watchers

Forks

Packages

No packages published