# Installation
vue-service-model
requires Vue.js v2
(opens new window) as dependencies.
# NPM
npm install vue-service-model
# Yarn
yarn add vue-service-model
# CDN
<!-- dependencies -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-service-model/dist/vue-service-model.min.js"></script>
For production, you should use a specific versions to avoid unexpected changes.
<script src="https://cdn.jsdelivr.net/npm/vue-service-model@0.18.1/dist/vue-service-model.min.js"></script>
WARNING
When using CDN you need to access from VueServiceModel
. E.g:
class MyModel extends VueServiceModel.ServiceModel {
[...]
}
# Integration of vue-async-computed
vue-service-model
can optionally make usage of vue-async-computed
(opens new window)
to achieve more reactivity when rendering components. In case you have vue-async-computed
(opens new window)
installed, then you need to enable it in the configuration.
import {setConfig} from 'vue-service-model'
setConfig({
useAsyncComputed: true
// ... your other configurations
})