master
xy 1 year ago
parent 5f0d6d90f6
commit c7ea369354

@ -56,6 +56,9 @@ VueAMap.initAMapApiLoader({
}) })
Vue.use(VueAMap) Vue.use(VueAMap)
import Carousel3d from 'vue-carousel-3d';
Vue.use(Carousel3d);
Vue.directive('loadMore', { Vue.directive('loadMore', {
bind(el, binding) { bind(el, binding) {
const selectWrap = el.querySelector('.el-scrollbar__wrap') const selectWrap = el.querySelector('.el-scrollbar__wrap')

@ -273,6 +273,7 @@ export default {
this.activeArea = this.areas[this.activeIndex]; this.activeArea = this.areas[this.activeIndex];
} else { } else {
this.activeIndex > 0 ? (--this.activeIndex) : (this.activeIndex = this.areas.length-1); this.activeIndex > 0 ? (--this.activeIndex) : (this.activeIndex = this.areas.length-1);
this.activeArea = this.areas[this.activeIndex];
} }
}, },
async getAreas() { async getAreas() {

@ -3,8 +3,12 @@
<div v-show="value" class="img-preview"> <div v-show="value" class="img-preview">
<div class="mask" @click.prevent.stop="$emit('input',false)"></div> <div class="mask" @click.prevent.stop="$emit('input',false)"></div>
<div class="img-container"> <div class="img-container">
<div style="background: #0d2067;height: 100%;width: 100%"> <div style="background: #0d2067;height: 100%;width: 100%;display: flex;justify-content: center;align-items: center;">
<carousel-3d :key="key" :autoplay="true" :autoplay-timeout="5000" :display="3" :perspective="40" :width="660" :height="460" :controlsVisible="true">
<slide v-for="(img, i) in imgs" :index="i">
<img style="width: 100%;height: 100%;object-fit: cover;" :src="img" alt="">
</slide>
</carousel-3d>
</div> </div>
</div> </div>
</div> </div>
@ -12,7 +16,12 @@
</template> </template>
<script> <script>
import { Carousel3d, Slide } from 'vue-carousel-3d';
export default { export default {
components: {
Carousel3d,
Slide,
},
props: { props: {
value: { value: {
type: Boolean, type: Boolean,
@ -25,10 +34,18 @@ export default {
} }
}, },
data() { data() {
return {} return {
key: 0
}
}, },
methods: {}, methods: {},
computed: {}, computed: {},
watch: {
imgs(newv) {
//
++this.key
}
}
} }
</script> </script>
@ -63,4 +80,8 @@ export default {
padding: 5px; padding: 5px;
} }
} }
::v-deep .carousel-3d-container {
margin: auto;
}
</style> </style>

Loading…
Cancel
Save