Commit 6b213ceaca06aa5a1407fa6b9e9ec569f193b84d

Authored by ly525
1 parent 7aa92591

update work cover style

front-end/h5/src/components/common/work/card-cover.js
1 export default { 1 export default {
2 props: { 2 props: {
3 - qrCode: String, 3 + qrcodeUrl: String,
4 coverImageUrl: String 4 coverImageUrl: String
5 }, 5 },
6 render (h) { 6 render (h) {
7 - if (this.qrcode) {  
8 - return <img src={this.qrcodeUrl} />  
9 - }  
10 - if (this.coverImageUrl) {  
11 - return <img src={this.coverImageUrl} style="width:100%;height: 100%;" /> 7 + const img = this.qrcodeUrl || this.coverImageUrl
  8 + if (img) {
  9 + const style = {
  10 + 'background-image': `url(${img})`,
  11 + 'background-size': this.qrcodeUrl ? 'contain' : 'cover'
  12 + }
  13 + return <div style={style} class="work-cover-img"></div>
12 } 14 }
13 15
14 return <span>Luban H5</span> 16 return <span>Luban H5</span>
front-end/h5/src/components/core/styles/index.scss
@@ -115,6 +115,14 @@ @@ -115,6 +115,14 @@
115 115
116 } 116 }
117 117
  118 + .work-cover-img {
  119 + background-size: contain;
  120 + width: 100%;
  121 + height: 100%;
  122 + background-repeat: no-repeat;
  123 + background-position: center center;
  124 + }
  125 +
118 } 126 }
119 127
120 .default-router-link { 128 .default-router-link {