main.js
1.19 KB
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
41
42
43
44
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from '@/router/index.js'
import GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css'
import { GlsxVueCommon, GlConst } from 'glsx-vue-common'
const { AppConst } = GlConst
// import _ from 'lodash'
Vue.use(GlsxVueComponents)
Vue.use(GlsxVueCommon)
var mixin = {
mounted () {
const theme = new this.$Theme()
const menus = new this.$get_config_by_key(AppConst.Auth.Resources.Key)
const connection = this.$Penpal.connectToParent({
methods: {
setTheme (color) {
theme.change(color)
},
setResources (resources) {
menus.change(resources)
},
height () {
return document.height || document.body.offsetHeight // document.documentElement.clientHeight || document.body.clientHeight //
}
}
})
connection.promise.then(parent => {
parent.onload()
})
}
}
/* eslint-disable no-new */
new Vue({
el: '#app',
mixins: [mixin],
router,
render: h => h(App)
})