<template> <SwiperImg v-if="imgs.length > 0" style="width: 300px; height: 450px; overflow: hidden" :gallery="imgs" /> <el-image v-else> <div slot="error" class="image-slot"> 暂无图片 </div> </el-image> </template> <script> import SwiperImg from "./SwiperImg.vue"; export default { components: { SwiperImg, }, props: { imgs: { type: Array, default: () => { return []; }, }, }, }; </script> <style lang="scss" scoped> .el-image { margin-top: 3px; width: 300px; height: 450px; line-height: 450px; overflow: hidden; text-align: center; background: #f5f7fa; color: #909399; } </style>