vue2-template
v0.0.4
Published
Vue2Template: Http component with Progress bar
Downloads
11
Maintainers
Readme
Vue2Template
Vue Component for Vue 2.x
Install
npm install vue2-template --save
Demo
For demo, please see here
Usage
1. Import the component
import Vue2Template from 'vue2-template';
2.1 Use it globally
Vue.use(Vue2Template);
// OR with options
Vue.use(Vue2Template, {baseURL: 'https://jsonplaceholder.typicode.com/', headers: {'X-API-KEY': 1234}});
*3. Access it locally
<template>
<vue2-template ref="http" v-model="data" :error-fn="onError"></vue2-template>
</template>
components: {
'vue2-template': Vue2Template
},
Properties
- value: any
Example
<template>
<div id="app" style="text-align: center">
<div>
<vue2-template v-model="data"></vue2-template>
<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 Vue2Template from '../src/index'
Vue.use(Vue2Template, {});
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