get-link-parameters
v1.0.1
Published
This plug-in is used to get url parameters
Downloads
4
Readme
get-url-params
This plug-in is used to get url parameters
Installation
npm install get-link-parameters --save-dev
way of introduction
1、global reference(全局引入)
// main.js
import getUrlParams from 'get-link-parameters'
Vue.prototype.$getUrlParams = getUrlParams
// App.vue
this.$getUrlParams('lang')
2、Import on demand(按需引入)
// App.vue
import getUrlParams from 'get-link-parameters'
getUrlParams('lang')
Usage
1、参数为空,获取当前url所有参数;
2、参数为1个时,获取当前url的指定参数;
3、参数为2个且第二个参数不为true时,获取指定url的指定参数;
4、参数为2个且第二个参数为true时,获取指定url的所有参数;