Skip to content

Commit

Permalink
feat(about.vue): create the aboutContentDefined hook
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Aug 2, 2021
1 parent 79967e2 commit 424504f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/config-examples/hooks-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,10 @@ appHooks.add('floatingMenuItemsDefined', (menuItems) => {
// }
return menuItems
})
appHooks.add('aboutContentDefined', (hookData) => {
// hookData has the following structure = {customAbout: HtmlNode, aboutContainer: HtmlNode, aboutLogo: HtmlNode}
// Do something
})
*/
4 changes: 2 additions & 2 deletions src/fragments/about/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div>
<div class="custom-about" ref="customAbout">
</div>
<div v-if="showDefaultAboutContent">
<div v-if="showDefaultAboutContent" ref="aboutContainer">
<header style="margin-top: 0">
<img height="auto" class="logo" src="@/assets/img/logo@2x.png" width="200px" />
<img ref="aboutLogo" height="auto" class="logo" src="@/assets/img/logo@2x.png" width="200px" />
</header>
<v-divider></v-divider>
<section>
Expand Down
7 changes: 3 additions & 4 deletions src/fragments/about/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import appConfig from '@/config/app-config'
import constants from '@/resources/constants'

export default {
computed: {
Expand All @@ -12,8 +11,8 @@ export default {
},
methods: {
callHook () {
let hookData = {containerRef: this.$refs.customAbout}
this.$root.appHooks.run('setCustomAbout', hookData)
}
let hookData = {customAbout: this.$refs.customAbout, aboutContainer: this.$refs.aboutContainer, aboutLogo: this.$refs.aboutLogo}
this.$root.appHooks.run('aboutContentDefined', hookData)
}
},
}

0 comments on commit 424504f

Please sign in to comment.