ivue-material
Version:
A high quality UI components Library with Vue.js
26 lines • 573 B
JavaScript
export default {
name: 'bootable',
props: {
lazy: Boolean
},
data () {
return {
isBooted: false
}
},
computed: {
hasContent () {
return this.isBooted || !this.lazy || this.isActive;
}
},
methods: {
showLazyContent (content) {
return this.hasContent ? content : undefined;
}
},
watch: {
isActive () {
this.isBooted = true;
}
}
}