mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
fix(Toast): failed to update message (#9196)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ref, App, TeleportProps, getCurrentInstance } from 'vue';
|
||||
import { ref, App, TeleportProps, getCurrentInstance, watch } from 'vue';
|
||||
import {
|
||||
extend,
|
||||
isObject,
|
||||
@@ -87,14 +87,14 @@ function createInstance() {
|
||||
onClosed,
|
||||
'onUpdate:show': toggle,
|
||||
};
|
||||
|
||||
if (message.value) {
|
||||
attrs.message = message.value;
|
||||
}
|
||||
|
||||
return <VanToast {...state} {...attrs} />;
|
||||
};
|
||||
|
||||
// support dynamic modification of message
|
||||
watch(message, (val) => {
|
||||
state.message = val;
|
||||
});
|
||||
|
||||
// rewrite render function
|
||||
(getCurrentInstance() as any).render = render;
|
||||
|
||||
|
Reference in New Issue
Block a user