index.vue
1.24 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
51
52
53
54
55
56
57
58
<template>
<div class="adapter-home" id="adapter-frame" ref="adapter-frame"></div>
</template>
<script>
import { Postmate } from 'glsx-common'
export default {
name: 'GLExternal',
data() {
return {
container: null
}
},
mounted() {
this.container = this.$refs['adapter-frame']
this.create(this.$router.currentRoute.meta.url)
},
methods: {
create(url) {
this.container.innerHTML = ''
new Postmate({
container: this.container,
url,
name: 'adapter-frame',
classListArray: ['adapter-frame'],
data: () => 'aaa'
}).then(child => {
child.get('height').then(height => {
child.frame.setAttribute('scrolling', 'no')
child.frame.style.height = `${height}px`
})
child.call('push', { src: this.src })
child.on('route-to', (id, params) => {
console.log(params)
this.$history.push(id)
})
})
}
}
}
</script>
<style>
.adapter-frame {
width: 100%;
min-height: calc(100vh - 90px);
border: 0;
overflow-y: hidden;
box-sizing: border-box;
/* position: absolute; */
transition: all 0.48s ease;
}
</style>
<style scoped lang="scss">
.app-view-box {
padding: 0 !important;
}
</style>