brotherton-erpnext/erpnext/public/js/education/web-academy.js
2019-02-19 13:06:30 +05:30

27 lines
856 B
JavaScript

import Vue from 'vue/dist/vue.js';
import VueRouter from 'vue-router/dist/vue-router.js'
import AcademyRoot from "./web-academy/AcademyRoot.vue";
import AcademyHome from "./web-academy/pages/AcademyHome.vue";
import AcademyProgramPage from "./web-academy/pages/AcademyProgramPage.vue";
import AcademyCoursePage from "./web-academy/pages/AcademyCoursePage.vue";
Vue.use(VueRouter)
const routes = [
{name: 'home', path: '', component: AcademyHome},
{name: 'program', path: '/Program/:code', component: AcademyProgramPage, props: true},
{name: 'content', path: '/Program/:code/:course/:type/:content', component: AcademyCoursePage, props: true},
];
const router = new VueRouter({
routes: routes,
});
frappe.ready(() => {
window.v = new Vue({
el: "#web-academy",
router: router,
template: "<academy-root/>",
components: { AcademyRoot }
});
})