vue-location

0.0.1 • Public • Published

vue-location


VersionDownloads

这是一个Vue2.x的一个处理URL的工具


Install

npm install vue-location --save

Usage

import Vue from 'vue'
import VueLocation from 'vue-location'

Vue.use(VueLocation);

Example


// url: localhost:8080/#/user/orders
this.$location.url();           // return '/user/orders'
this.$location.url('/about');   // localhost:8080/#/about
this.$location.url('about');    // localhost:8080/#/user/about

// url: localhost:8080/#/user/orders?page=1
this.$location.search();                              // return { page: 1 }
this.$location.search({ pagesize: 10 });              // localhost:8080/#/user/orders?page=1&pagesize=10
this.$location.search({ pagesize: 10, page: 2 });     // localhost:8080/#/user/orders?page=2&pagesize=10
this.$location.clear();                               // localhost:8080/#/user/orders

Readme

Keywords

Package Sidebar

Install

npm i vue-location

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • simsir