This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/components/common/Loading.vue

67 lines
1.2 KiB
Vue
Raw Normal View History

2022-01-16 23:16:00 +08:00
<template>
2022-08-29 17:29:45 +08:00
<div class="chart__loading" v-show="loading">
2022-08-24 19:17:54 +08:00
<!-- <img :class="className" :src="path" alt="" :style="innerStyle">-->
2022-08-29 17:29:45 +08:00
<div class="cn-loading" :class="className">
2022-08-24 19:17:54 +08:00
<div class="cn-loading__inner">
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
</div>
</div>
2022-01-16 23:16:00 +08:00
</div>
</template>
<script>
export default {
name: 'loading',
props: {
2022-05-26 17:14:00 +08:00
loading: Boolean,
size: {
type: String,
default: 'default' // large default small
},
innerStyle: String
2022-01-16 23:16:00 +08:00
},
data () {
return {
showLoading: false
}
},
methods: {
startLoading () {
this.showLoading = true
},
endLoading () {
this.showLoading = false
}
},
watch: {
loading: {
deep: true,
immediate: true,
handler (n) {
this.showLoading = n
}
}
2022-05-26 17:14:00 +08:00
},
2022-08-29 17:29:45 +08:00
setup (props) {
2022-05-26 17:14:00 +08:00
let className = ''
switch (props.size) {
case 'large': {
2022-08-29 17:29:45 +08:00
className = 'cn-loading--large'
2022-05-26 17:14:00 +08:00
break
}
case 'small': {
2022-08-29 17:29:45 +08:00
className = 'cn-loading--small'
2022-05-26 17:14:00 +08:00
break
}
default: {
2022-08-29 17:29:45 +08:00
className = 'cn-loading--default'
2022-05-26 17:14:00 +08:00
break
}
}
return {
className
}
2022-08-29 17:29:45 +08:00
}
2022-01-16 23:16:00 +08:00
}
</script>