This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/mixins/bootable/index.js
2019-08-11 20:48:02 +02:00

51 lines
No EOL
864 B
JavaScript

// Utilities
import { removed } from '../../util/console'; // Types
import Vue from 'vue';
/**
* Bootable
* @mixin
*
* Used to add lazy content functionality to components
* Looks for change in "isActive" to automatically boot
* Otherwise can be set manually
*/
/* @vue/component */
export default Vue.extend().extend({
name: 'bootable',
props: {
eager: Boolean
},
data: () => ({
isBooted: false
}),
computed: {
hasContent() {
return this.isBooted || this.eager || this.isActive;
}
},
watch: {
isActive() {
this.isBooted = true;
}
},
created() {
/* istanbul ignore next */
if ('lazy' in this.$attrs) {
removed('lazy', this);
}
},
methods: {
showLazyContent(content) {
return this.hasContent ? content : undefined;
}
}
});
//# sourceMappingURL=index.js.map