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

51 lines
864 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
// 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