UNPKG

1.31 kBJavaScriptView Raw
1import { install } from './install'; // Services
2
3import * as services from './services'; // Styles
4
5import "../src/styles/main.sass";
6export default class Vuetify {
7 constructor(preset = {}) {
8 this.framework = {};
9 this.installed = [];
10 this.preset = {};
11 this.preset = preset;
12 this.use(services.Application);
13 this.use(services.Breakpoint);
14 this.use(services.Goto);
15 this.use(services.Icons);
16 this.use(services.Lang);
17 this.use(services.Theme);
18 } // Called on the new vuetify instance
19 // bootstrap in install beforeCreate
20 // Exposes ssrContext if available
21
22
23 init(root, ssrContext) {
24 this.installed.forEach(property => {
25 const service = this.framework[property];
26 service.framework = this.framework;
27 service.init(root, ssrContext);
28 }); // rtl is not installed and
29 // will never be called by
30 // the init process
31
32 this.framework.rtl = Boolean(this.preset.rtl);
33 } // Instantiate a VuetifyService
34
35
36 use(Service) {
37 const property = Service.property;
38 if (this.installed.includes(property)) return;
39 this.framework[property] = new Service(this.preset[property]);
40 this.installed.push(property);
41 }
42
43}
44Vuetify.install = install;
45Vuetify.installed = false;
46Vuetify.version = "2.1.4";
47//# sourceMappingURL=framework.js.map
\No newline at end of file