forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.js
More file actions
40 lines (35 loc) · 921 Bytes
/
install.js
File metadata and controls
40 lines (35 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import Platform from './features/platform'
import { installEvents } from './features/events'
import { current as theme } from './features/theme'
import { version } from '../package.json'
import { setVue } from './deps'
export default function (_Vue, opts = {}) {
if (this.installed) {
return
}
this.installed = true
setVue(_Vue)
if (opts.directives) {
Object.keys(opts.directives).forEach(key => {
let d = opts.directives[key]
if (d.name !== undefined && !d.name.startsWith('q-')) {
_Vue.directive(d.name, d)
}
})
}
if (opts.components) {
Object.keys(opts.components).forEach(key => {
let c = opts.components[key]
if (c.name !== undefined && c.name.startsWith('q-')) {
_Vue.component(c.name, c)
}
})
}
const events = installEvents(_Vue)
_Vue.prototype.$q = {
version,
platform: Platform,
theme,
events
}
}