C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.wxml 858 B

6 years ago
123456789101112131415161718192021222324252627
  1. <view
  2. class="i-class i-tag {{ parse.getClass(color,type,checked,checkable) }} {{checkable ? '' : 'i-tag-disable'}}"
  3. bindtap="tapTag">
  4. <slot></slot>
  5. </view>
  6. <wxs module="parse">
  7. module.exports = {
  8. getClass : function(color,type,checked,checkable) {
  9. var initColorList = ['blue', 'green', 'red', 'yellow', 'default'];
  10. var theme = '';
  11. var className = 'i-tag-';
  12. if( initColorList.indexOf( color ) > -1 ){
  13. theme = className + color;
  14. }
  15. if( type === 'border' ){
  16. theme = className+color+'-border';
  17. }
  18. if( checkable && checked ){
  19. theme = className+color+'-checked';
  20. }else if( checkable && !checked ){
  21. theme = ( type === 'border' ? className + color +'-border' : className+'none' );
  22. }
  23. return theme;
  24. }
  25. }
  26. </wxs>