base.js
1.39 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
45
46
47
48
49
50
// 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 GlsxVueComponents from 'glsx-vue-components'
import 'glsx-vue-components/dist/glsx-vue-components.css'
import GlsxVueCommon from 'glsx-vue-common'
import { common } from '@/config'
import './styles/role-user-common.scss'
import './styles/index.scss'
import './date.js'
// import _ from 'lodash'
import { MenuManager, Tree } from '@/components'
Vue.use(GlsxVueComponents)
Vue.component('menuManager', MenuManager)
Vue.component('tree', Tree)
Vue.use(GlsxVueCommon, common)
var mixin = {
mounted() {
const _this = this
const theme = new this.$Theme()
const connection = this.$Penpal.connectToParent({
methods: {
setTheme(color) {
theme.change(color)
},
height() {
return document.height || document.body.offsetHeight // document.documentElement.clientHeight || document.body.clientHeight //
}
}
})
connection.promise.then(parent => {
const cfg = _this.$get_session_config()
if (cfg) return
parent.getResources().then(config => {
_this.$set_session_config(config)
})
})
}
}
/* eslint-disable no-new */
const render = App => {
new Vue({
el: '#app',
mixins: [mixin],
render: h => h(App)
})
}
export default { render }