Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tianfanfan/vue-router-query-merge
vue-router-query-merge 自动合并 query 对象。
https://github.com/tianfanfan/vue-router-query-merge
Last synced: about 2 months ago
JSON representation
vue-router-query-merge 自动合并 query 对象。
- Host: GitHub
- URL: https://github.com/tianfanfan/vue-router-query-merge
- Owner: tianfanfan
- Created: 2018-12-19T05:17:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T05:57:13.000Z (about 6 years ago)
- Last Synced: 2024-11-01T10:17:23.371Z (3 months ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-router-query-merge
> a plugin for vue with rouer query push.
## How to use
```bash
$ npm install -S vue-router-query-merge
```## Example
```javascript
// main.js
import Vue from 'vue'
import queryPushPlugin from 'vue-router-query-merge'Vue.use(queryPushPlugin)
// foo.vue
methods:{
jump() {
// meas: router query push
this.$routerQpush({bar: 'bar'})
// it will just change query ,and add more prop { bar: bar } , use router.push.
// 这个函数会添加新的 query ,并和旧的合并,并跳转。
},
replace() {
// meas: router query replace
this.$routerQrep({bar: 'bar'})
// it will just change query ,and add more prop { bar: bar }, use replace.
// 这个函数会添加新的 query ,并和旧的合并,并重定向。
},
jumpNew() {
// meas: router new query push
this.$routerNQrep({bar: 'bar'})
// it will change query , only { bar: bar },use router.push
// 这个函数会用全新的 query ,并跳转。
},
replaceNew() {
// meas: router new query replace
this.$routerNQrep({bar: 'bar'})
// it will change query , only { bar: bar },use replace
// 这个函数会用全新的 query ,并重定向。
}
}
```## Attribute
##### none
## License[MIT](http://opensource.org/licenses/MIT)