Skip to content

Commit

Permalink
LITE-28659: Listen to "containerSize" event via the toolkit to set th…
Browse files Browse the repository at this point in the history
…e minHeight of the extension
  • Loading branch information
arnaugiralt committed Sep 22, 2023
1 parent e2fbda9 commit ed2583e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
22 changes: 21 additions & 1 deletion ui/src/pages/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
<template lang="pug">
.app
.app(:style="styles")
portal-target(name="destination", multiple)
router-view

</template>

<script>
export default {
props: {
// This is the toolkit instance itself
toolkit: Object,
},
data: () => ({
height: '',
}),
computed: {
styles: vm => ({
minHeight: vm.height,
}),
},
created() {
this.toolkit.listen('containerSize', ({ height }) => {
this.height = height;
});
},
};
</script>
25 changes: 14 additions & 11 deletions ui/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ createApp({
'ui-tab': Tab,
'ui-tabs': Tabs,
'ui-pad': Pad,
});
}).then(toolkit => {
const router = new VueRouter({
mode: 'hash',
routes,
});

const router = new VueRouter({
mode: 'hash',
routes,
});
Vue.filter('utcToLocal', utcToLocal);

Vue.filter('utcToLocal', utcToLocal);
const app = new Vue({
render: h => h(App, {
props: { toolkit },
}),

const app = new Vue({
render: h => h(App),
router,
});
router,
});

app.$mount('#app');
app.$mount('#app');
});

0 comments on commit ed2583e

Please sign in to comment.