feat(Toast): support html of type (#4581)

This commit is contained in:
nemo-shen 2021-10-28 09:43:54 +08:00 committed by GitHub
parent b5ca0bdd44
commit 5ac2e5dde7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,12 +10,15 @@
custom-class="van-toast__container" custom-class="van-toast__container"
> >
<view <view
class="van-toast van-toast--{{ type === 'text' ? 'text' : 'icon' }} van-toast--{{ position }}" class="van-toast van-toast--{{ type === 'icon' ? 'icon' : 'text' }} van-toast--{{ position }}"
catch:touchmove="noop" catch:touchmove="noop"
> >
<!-- text only --> <!-- text only -->
<text wx:if="{{ type === 'text' }}">{{ message }}</text> <text wx:if="{{ type === 'text' }}">{{ message }}</text>
<!-- html only -->
<rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
<!-- with icon --> <!-- with icon -->
<block wx:else> <block wx:else>
<van-loading <van-loading