binquan.qiu | 7f2665f | 2020-03-27 17:19:57 +0800 | [diff] [blame] | 1 | <wxs module="utils"> |
| 2 | var double = function(a) { |
| 3 | return 2*a |
| 4 | }; |
| 5 | var ifSpecialIcon = function(v) { |
| 6 | return v === 'arrow' || v === 'back' |
| 7 | } |
| 8 | module.exports = { |
| 9 | double: double, |
| 10 | ifSpecialIcon: ifSpecialIcon |
| 11 | } |
| 12 | </wxs> |
| 13 | |
| 14 | <view class="{{extClass}} weui-icon" style="background:{{color}};width:{{size}}px;height:{{ utils.ifSpecialIcon(icon) ? utils.double(size) : size}}px;mask-image:url({{src}});-webkit-mask-image:url({{src}});-moz-mask-image:url({{src}})"></view> |