vue-connect-search
v0.2.2
Published
simple route search sync manager
Downloads
13
Maintainers
Readme
vue-connect-search
simple route search sync manager
install
import Vue from 'vue'
import VueConnectSearch from 'vue-connect-search'
Vue.use(VueConnectSearch)
in your component
when url is [path]?a=3&b=3&c=6
$search will be {a:3,b:'3',c:'6'}
<template>
<!-- auto merged by route.query && default schema -->
{{$search}}
</template>
<script>
import { getList } from '@/api/custom-service'
export default {
connectSearch:{
schema:{
a: {type: Number,default: 0},
b: {type: String,default: ''}
},
// will called when query changed (notice when params change,this will NOT trigger)
onQueryChange(){
},
// will trigger when params change
onParamsChange(){
}
}
}
</script>
Development Setup
# install deps
npm install
# serve demo at localhost:8080
npm run dev
# build library and demo
npm run build
# build library
npm run build:library
# build demo
npm run build:demo
License
Copyright (c) 2018 FlynnLee