Skip to content

Instantly share code, notes, and snippets.

@Luke-SNAW
Last active December 22, 2021 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luke-SNAW/8860c2730247cb92c90dac75271355d2 to your computer and use it in GitHub Desktop.
Save Luke-SNAW/8860c2730247cb92c90dac75271355d2 to your computer and use it in GitHub Desktop.
[Lazy Renderer] #vue
<template>
<div v-if="isTimeToRender">
<slot />
</div>
</template>
<script>
export default {
props: {
timeToRender: { type: Number, default: 300 },
},
data: () => ({ isTimeToRender: false }),
created() {
setTimeout(() => {
this.isTimeToRender = true
}, this.timeToRender)
},
}
</script>
<script>
import LazyRenderer from '@/components/common/lazy-renderer'
const HorizontalScroll = () =>
import(
/* webpackChunkName: "CancerDiseasesRest" */ './international-intro__horizontal-scroll.vue'
)
export default {
components: {
LazyRenderer,
HorizontalScroll,
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment