Skip to main content

Models and Collections

Models and collections are based on vue-mc project#

Dependencies#

Add the vue-mc package

npm install --save vue-mc
# Or
yarn add vue-mc

Models and Collections extends vue-mc package, first see their docs.

Install#

# Add main packages
yarn add @planetadeleste/vue-mc

Configuration#

On your vue project, add this lines

import Vue from "vue";
import { Base } from "@planetadeleste/vue-mc";
// Set API Model
const laroute = require("./laroute.js");
Base.$resolve = laroute.route;
Base.$http = Vue.axios;

You can use vuex modules for loading, messaging and auth

import Vue from "vue";
import { Base } from "@planetadeleste/vue-mc";
import { AuthModule } from "@/store/auth";
import { LoadingModule } from "@/store/loading";
import { FlashModule } from "@/store/flash";
// Set API Model
const laroute = require("./laroute.js");
Base.$resolve = laroute.route;
Base.$authModule = AuthModule;
Base.$flashModule = FlashModule;
Base.$loadingModule = LoadingModule;
Base.$http = Vue.axios;