<!-- * @Description: 模块容器 * @Author: 王晓颖 * @Date:2020-08-10 --> <template> <div :class="modularClass" :style="{backgroundImage:`url(${background})`}"> <slot></slot> </div> </template> <script> export default { name: 'ModularLayout', props: { type: { type: String, default: '' // 边框样式:roundCorner } }, computed: { modularClass () { switch (this.type) { case 'roundCorner': return 'round-corner-modular' default: return '' } }, background () { switch (this.type) { case 'roundCorner': return require('@/assets/images/left_1_bg.png') default: return '' } } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .round-corner-modular{ width: 98%; height: 97%; /*background: url(/static/img/left_1_bg.fb65160.png) no-repeat;*/ background-size: 100% 100%; margin: 0 2%; overflow: hidden; position: relative; } </style>