mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
Initial commit
This commit is contained in:
commit
d76f4258f7
231 files changed
+27803
No files matched your search
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="!content"></div>
|
||||
<div v-else-if="content?.error">{{ content.error }}</div>
|
||||
<div v-else-if="(typeof content == 'array' && !array.length) || (typeof content == 'object' && !Object.values(content).length)">{{ emptyMessage }}</div>
|
||||
<slot v-else></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
content: {
|
||||
type: [Object, Array, Boolean],
|
||||
default: null,
|
||||
},
|
||||
|
||||
emptyMessage: {
|
||||
type: String,
|
||||
default: 'No items'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loader: null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
created() {
|
||||
this.startLoading()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async startLoading() {
|
||||
if (!this.content)
|
||||
this.loader = await this.$loading.show()
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
content(newValue) {
|
||||
if (newValue)
|
||||
this.loader.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
div
|
||||
height: calc( 100vh - 329px )
|
||||
</style>
|
||||
Reference in new issue
Block a user