vue-query-parser

1.1.0 • Public • Published

vue-query-parser

A Vue plugin used to sync data between vue-router query and component data.

Sync is automatically invoked after user trigger browser navigate or refresh page.

Install

npm install vue-query-parser --save

Usage

componentName.vue

import vueQueryParser from 'vue-query-parser'
 
export default {
  mixin: [vueQueryParser.vueMixin],
  queryParser: {
    target: ['pager']
    type: {
      'Number': ['pageIndex', 'pageSize']
    }
  },
  data () {
    list: [],
    pager: {
      pageIndex: 1,
      pageSize: 10
    }
  }
}

Package Sidebar

Install

npm i vue-query-parser

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • zhongxingdou