index.wxml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <van-overlay
  2. wx:if="{{ mask || forbidClick }}"
  3. show="{{ show }}"
  4. z-index="{{ zIndex }}"
  5. custom-style="{{ mask ? '' : 'background-color: transparent;' }}"
  6. />
  7. <van-transition
  8. show="{{ show }}"
  9. custom-style="z-index: {{ zIndex }}"
  10. custom-class="van-toast__container"
  11. >
  12. <view
  13. class="van-toast van-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }} van-toast--{{ position }}"
  14. catch:touchmove="noop"
  15. >
  16. <!-- text only -->
  17. <text wx:if="{{ type === 'text' }}">{{ message }}</text>
  18. <!-- html only -->
  19. <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
  20. <!-- with icon -->
  21. <block wx:else>
  22. <van-loading
  23. wx:if="{{ type === 'loading' }}"
  24. color="white"
  25. type="{{ loadingType }}"
  26. custom-class="van-toast__loading"
  27. />
  28. <van-icon wx:else class="van-toast__icon" name="{{ type }}" />
  29. <text wx:if="{{ message }}" class="van-toast__text">{{ message }}</text>
  30. </block>
  31. <slot />
  32. </view>
  33. </van-transition>