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