mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-15 19:28:11 +00:00
38 lines
793 B
Vue
38 lines
793 B
Vue
<template>
|
|
<PreviewImage v-model="show" :index="previewImageIndex" :list="previewImageList"/>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapState} from "vuex";
|
|
import PreviewImage from "./index";
|
|
|
|
export default {
|
|
name: 'PreviewImageState',
|
|
components: {PreviewImage},
|
|
computed: {
|
|
...mapState([
|
|
'previewImageIndex',
|
|
'previewImageList',
|
|
]),
|
|
},
|
|
data() {
|
|
return {
|
|
show: false,
|
|
}
|
|
},
|
|
watch: {
|
|
show(v) {
|
|
if (!v) {
|
|
this.$store.state.previewImageIndex = 0;
|
|
this.$store.state.previewImageList = [];
|
|
}
|
|
},
|
|
previewImageList(l) {
|
|
if (l.length > 0) {
|
|
this.show = true;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|