Skip to content

Commit

Permalink
Fix toast
Browse files Browse the repository at this point in the history
  • Loading branch information
khang-nd committed Dec 17, 2023
1 parent 4a99cd6 commit e5608ba
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions src/.vuepress/components/GAffiliates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,37 @@ import "vue-toastification/dist/index.css";
export default {
data() {
return {
mounted: false,
toast: createToastInterface({
container: document.querySelector("#app"),
timeout: false,
position: POSITION.BOTTOM_LEFT,
showCloseButtonOnHover: true,
}),
/** @type {ReturnType<createToastInterface>} */
toast: null,
};
},
watch: {
$route: {
deep: true,
immediate: true,
handler(route) {
if (route.path === "/" || this.mounted) return;
const Content = (
<a
href="https://shipfa.st/?via=visnalize"
target="_blank"
style="display: block; color: #fff; margin-top: 8px"
>
Build and launch your web app in days
<span style="display: flex; align-items: center; justify-content: center">
<span style="margin-right: 8px">Check out</span>
<img
src="https://shipfa.st/_next/image?url=%2F_next%2Fstatic%2Fmedia%2FlogoAndName_transparent.9c74ebc0.png&w=128&q=100"
alt="ShipFast"
/>
</span>
</a>
);
this.toast(Content);
this.mounted = true;
},
mounted() {
this.toast = createToastInterface({
container: this.$root.$el,
timeout: false,
position: POSITION.BOTTOM_LEFT,
showCloseButtonOnHover: true,
});
this.toast(this.getContent());
},
methods: {
getContent() {
return (
<a
href="https://shipfa.st/?via=visnalize"
target="_blank"
style="display: block; color: #fff; margin-top: 8px"
>
Build and launch your web app in days
<span style="display: flex; align-items: center; justify-content: center">
<span style="margin-right: 8px">Check out</span>
<img
src="https://shipfa.st/_next/image?url=%2F_next%2Fstatic%2Fmedia%2FlogoAndName_transparent.9c74ebc0.png&w=128&q=100"
alt="ShipFast"
/>
</span>
</a>
);
},
},
};
Expand Down

0 comments on commit e5608ba

Please sign in to comment.