From f157e99534401aaca50a6e4717fbe7e98c99740e Mon Sep 17 00:00:00 2001 From: neverland <chenjiahan@youzan.com> Date: Sat, 23 Jan 2021 11:08:52 +0800 Subject: [PATCH] fix(Dialog): failed to render when toggling allowHtml (#7968) --- src/dialog/Dialog.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dialog/Dialog.js b/src/dialog/Dialog.js index 95edeccf6..f59792fd8 100644 --- a/src/dialog/Dialog.js +++ b/src/dialog/Dialog.js @@ -120,7 +120,12 @@ export default createComponent({ if (message) { const hasTitle = title || slots.title; 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 class={bem('message', { 'has-title': hasTitle,