| | |
| | | // #ifdef APP-NVUE |
| | | width: 0, // nvue下才这么计算,vue下放到computed中,否则会因为延时造成闪烁 |
| | | // #endif |
| | | // #ifdef MP-TOUTIAO |
| | | width: '100%', |
| | | // #endif |
| | | classes: [], // 类名集合,用于判断是否显示右边和下边框 |
| | | }; |
| | | }, |
| | |
| | | }, |
| | | // #endif |
| | | computed: { |
| | | // #ifndef APP-NVUE || MP-TOUTIAO |
| | | // vue下放到computed中,否则会因为延时造成闪烁 |
| | | width() { |
| | | if (this.parentData.col > 0) { |
| | | return 100 / Number(this.parentData.col) + '%' |
| | | } else { |
| | | return 0; |
| | | } |
| | | }, |
| | | // #endif |
| | | itemStyle() { |
| | | const style = { |
| | | background: this.bgColor, |
| | | // #ifndef MP |
| | | width: this.width |
| | | // #endif |
| | | // #ifdef MP |
| | | width: '100%' |
| | | // #endif |
| | | background: this.bgColor |
| | | } |
| | | // #ifdef APP-NVUE |
| | | style['width'] = this.width |
| | | // #endif |
| | | // #ifndef APP-NVUE |
| | | style['width'] = '100%' |
| | | // #endif |
| | | return deepMerge(style, addStyle(this.customStyle)) |
| | | } |
| | | }, |