index.wxml 915 B

123456789101112131415161718192021222324252627282930313233
  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' ? 'text' : 'icon' }} van-toast--{{ position }}"
  14. catch:touchmove="noop"
  15. >
  16. <!-- text only -->
  17. <text wx:if="{{ type === 'text' }}">{{ message }}</text>
  18. <!-- with icon -->
  19. <block wx:else>
  20. <van-loading
  21. wx:if="{{ type === 'loading' }}"
  22. color="white"
  23. type="{{ loadingType }}"
  24. custom-class="van-toast__loading"
  25. />
  26. <van-icon wx:else class="van-toast__icon" name="{{ type }}" />
  27. <text wx:if="{{ message }}" class="van-toast__text">{{ message }}</text>
  28. </block>
  29. <slot />
  30. </view>
  31. </van-transition>