Skip to content

Commit

Permalink
Merge pull request #9 from f-necas/feat/legacy-option
Browse files Browse the repository at this point in the history
feat: add legacy option to display iframe
  • Loading branch information
tkohr authored Oct 26, 2023
2 parents 7f5ee06 + 998df03 commit 78c4184
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ To include it in an existing application:

Note: unlike with iframes there is no need to specify a height, the component will decide of its own size and "push" the content around accordingly.

Iframe can still be set with defining `legacy-url` attribute, style can also be set with `legacy-style` attribute :
```html
<geor-header legacy-url="myheader.com" legacy-style="width: 100%"></geor-header>
```


## Development

On every new commit on main the `header.js` file on the `dist` branch is updated automatically.
Expand Down
11 changes: 10 additions & 1 deletion src/header.ce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import UserIcon from './ui/UserIcon.vue'
const props = defineProps<{
lang?: string
activeApp?: string
//legacy option : using old iframe option
legacyUrl?: string
legacyStyle?: string
}>()
const state = reactive({
Expand All @@ -31,7 +34,13 @@ onMounted(() => {
})
</script>
<template>
<header class="host">
<div v-if="props.legacyUrl">
<iframe
v-bind:src="props.legacyUrl"
v-bind:style="props.legacyStyle"
></iframe>
</div>
<header v-if="!props.legacyUrl" class="host">
<div
class="admin pr-8 items-center bg-primary/20 text-secondary/80 flex justify-end gap-5 text-sm font-sans"
v-if="isAdmin"
Expand Down

0 comments on commit 78c4184

Please sign in to comment.