fix(Dialog): failed to render when toggling allowHtml (#7968)

This commit is contained in:
neverland 2021-01-23 11:08:52 +08:00 committed by GitHub
parent c30740ecc5
commit f157e99534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,12 @@ export default createComponent({
if (message) { if (message) {
const hasTitle = title || slots.title; const hasTitle = title || slots.title;
return ( return (
<div class={bem('content', { isolated: !hasTitle })}> <div
// add key to force re-render
// see: https://github.com/youzan/vant/issues/7963
key={allowHtml ? 1 : 0}
class={bem('content', { isolated: !hasTitle })}
>
<div <div
class={bem('message', { class={bem('message', {
'has-title': hasTitle, 'has-title': hasTitle,