vue2-saas-proxy
v0.0.6
Published
Vue2SaasProxy: Http component with Progress bar
Downloads
6
Maintainers
Readme
Vue2SaasProxy
Loads a Vue component or site as service, waits for it and allows you to access it natively from your projects
Install
npm install vue2-saas-proxy --save
Demo
For demo, please see here
Usage
1. Import the component
import Vue2SaasProxy from 'vue2-saas-proxy';
2.1 Use it globally
Vue.use(Vue2SaasProxy);
// OR with options
Vue.use(Vue2SaasProxy, {baseURL: 'https://jsonplaceholder.typicode.com/', headers: {'X-API-KEY': 1234}});
*3. Access it locally
<template>
<vue2-saas-proxy ref="http" v-model="data" :error-fn="onError"></vue2-saas-proxy>
</template>
components: {
'vue2-saas-proxy': Vue2SaasProxy
},
Properties
- value: any
Example
<template>
<div id="app" style="text-align: center">
<div>
<vue2-saas-proxy v-model="data"></vue2-saas-proxy>
<pre>{{data}}</pre>
<button class="btn btn-primary btn-sm" type="button" @click="test">Test</button>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import Vue2SaasProxy from '../src/index'
Vue.use(Vue2SaasProxy, {});
export default {
name: 'app',
data() {
return {
data: {},
}
},
methods: {
test() {
// code
}
},
}
</script>
Contributing
Contributions are welcome
Build Setup
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build