mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-26 03:16:35 +08:00
chore(Toast): improve clear method
This commit is contained in:
parent
6e6cfe5c65
commit
4ddf4e7018
@ -42,11 +42,7 @@ function createInstance() {
|
|||||||
const { instance, unmount } = mountComponent({
|
const { instance, unmount } = mountComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const message = ref();
|
const message = ref();
|
||||||
const { open, state, toggle } = usePopupState();
|
const { open, state, close, toggle } = usePopupState();
|
||||||
|
|
||||||
const clear = () => {
|
|
||||||
toggle(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onClosed = () => {
|
const onClosed = () => {
|
||||||
if (allowMultiple) {
|
if (allowMultiple) {
|
||||||
@ -61,8 +57,8 @@ function createInstance() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
open,
|
open,
|
||||||
clear,
|
|
||||||
state,
|
state,
|
||||||
|
clear: close,
|
||||||
toggle,
|
toggle,
|
||||||
message,
|
message,
|
||||||
onClosed,
|
onClosed,
|
||||||
|
@ -26,6 +26,7 @@ export function usePopupState() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
open,
|
open,
|
||||||
|
close,
|
||||||
state,
|
state,
|
||||||
toggle,
|
toggle,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user