tag.wxml 919 B

123456789101112131415161718192021222324
  1. <view class="tui-tag-class {{size?'tui-tag-'+size:'tui-tag'}} {{parse.getClassName(shape,plain)}} {{parse.getTypeClass(type,plain)}}" bindtap="handleClick" wx:if="{{visible}}">
  2. <slot></slot>
  3. </view>
  4. <wxs module="parse">
  5. module.exports = {
  6. getTypeClass: function(type, plain) {
  7. return plain ? 'tui-' + type + '-outline' : 'tui-' + type
  8. },
  9. getClassName: function(shape, plain) {
  10. //circle, square,circleLeft,circleRight
  11. var className = plain ? 'tui-tag-outline ' : '';
  12. if (shape != 'square') {
  13. if (shape == "circle") {
  14. className = className + (plain ? 'tui-tag-outline-fillet' : 'tui-tag-fillet');
  15. } else if (shape == "circleLeft") {
  16. className = className + 'tui-tag-fillet-left';
  17. } else if (shape == "circleRight") {
  18. className = className + 'tui-tag-fillet-right';
  19. }
  20. }
  21. return className;
  22. }
  23. }
  24. </wxs>